> This page is for Itential Platform On-Prem, version 6 (default).
> For other versions, use one of these documentation indexes:
> - 6 (default): https://docs-test.itntl.com/itential-platform/6/llms.txt
> - 2023.2: https://docs-test.itntl.com/itential-platform/2023-2/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-test.itntl.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-test.itntl.com/_mcp/server.

# Get service accounts from the database

GET https://example.itential.io/oauth/serviceAccounts

Returns service accounts from the database.

Reference: https://docs-test.itntl.com/itential-platform/6/api-reference/oauth/get-service-accounts

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.

## Request

### Query parameters

- `multiContains` (OauthServiceAccountsGetParametersMultiContains, optional) — multiContains
- `multiEquals` (OauthServiceAccountsGetParametersMultiEquals, optional) — multiEquals
- `multiStartsWith` (OauthServiceAccountsGetParametersMultiStartsWith, optional) — multiStartsWith
- `skip` (integer, optional, default: 0) — skip
- `limit` (integer, optional, default: 25) — limit
- `sort` (enum, optional, default: name) — sort
  - Allowed values: `name`
- `order` (enum, optional, default: 1) — order
  - Allowed values: `-1`, `1`

## Response

### 200

The service accounts matching the specified query.

- `results` (list of OauthServiceAccountsGetResponsesContentApplicationJsonSchemaResultsItems, optional)
- `total` (integer, optional) — The total number of documents

## Errors

### 500 Internal Server Error

Error response from API

- `any`

## Types

### OauthServiceAccountsGetParametersMultiContains

- `name` (string, optional) — The name associated with the service account
- `description` (string, optional) — The description of the service account

### OauthServiceAccountsGetParametersMultiEquals

- `name` (string, optional) — The name associated with the service account
- `description` (string, optional) — The description of the service account

### OauthServiceAccountsGetParametersMultiStartsWith

- `name` (string, optional) — The name associated with the service account
- `description` (string, optional) — The description of the service account

### OauthServiceAccountsGetResponsesContentApplicationJsonSchemaResultsItems

- `name` (string, optional) — The name associated with the service account
- `description` (string, optional) — The description of the service account
- `client_id` (string, optional) — String representation of a MongoDB ObjectId
- `_meta` (OauthServiceAccountsGetResponsesContentApplicationJsonSchemaResultsItemsMeta, optional)

### OauthServiceAccountsGetResponsesContentApplicationJsonSchemaResultsItemsMeta

- `created` (string, optional)
- `createdBy` (iap_service-accounts-schema_modifiedByDereferenced, optional)
- `updated` (string, optional)
- `updatedBy` (iap_service-accounts-schema_modifiedByDereferenced, optional)
- `secretUpdated` (string, optional)

### iap_service-accounts-schema_modifiedByDereferenced

- `_id` (string, optional) — String representation of a MongoDB ObjectId
- `username` (string, optional)

## Examples

**Response**

```json
{
  "results": [
    {
      "name": "ExampleName",
      "description": "This is a service account for the external Example system",
      "client_id": "5cb7b531d06cceb89fd21b1c",
      "_meta": {
        "created": "2018-08-02T15:56:12.912Z",
        "createdBy": {
          "_id": "5cb7b531d06cceb89fd21b1c",
          "username": "username@itential"
        },
        "updated": "2018-08-02T15:56:12.912Z",
        "updatedBy": {
          "_id": "5cb7b531d06cceb89fd21b1c",
          "username": "username@itential"
        },
        "secretUpdated": "2018-08-02T15:56:12.912Z"
      }
    }
  ],
  "total": 1
}
```

**SDK Code**

```python
import requests

url = "https://example.itential.io/oauth/serviceAccounts"

querystring = {"limit":"1","skip":"1"}

response = requests.get(url, params=querystring)

print(response.json())
```

```javascript
const url = 'https://example.itential.io/oauth/serviceAccounts?limit=1&skip=1';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://example.itential.io/oauth/serviceAccounts?limit=1&skip=1"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://example.itential.io/oauth/serviceAccounts?limit=1&skip=1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://example.itential.io/oauth/serviceAccounts?limit=1&skip=1")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://example.itential.io/oauth/serviceAccounts?limit=1&skip=1');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://example.itential.io/oauth/serviceAccounts?limit=1&skip=1");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://example.itential.io/oauth/serviceAccounts?limit=1&skip=1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```