> For the complete documentation index, see [llms.txt](https://docs.plock.io/plock-overview/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plock.io/plock-overview/use-cases/for-developers/api/endpoints/accounts.md).

# Accounts

Accounts

## GET /api/c1/accounts

> Get all accounts

```json
{"openapi":"3.1.0","info":{"title":"Plock external API","version":"0.2.1"},"tags":[{"name":"Accounts","description":"Accounts"}],"servers":[{"url":"https://api.plock.io","description":"Production"},{"url":"https://test-api.plock.io","description":"Test"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"JsonApiMeta":{"properties":{"page":{"properties":{"currentPage":{"type":"integer"},"from":{"type":"integer"},"lastPage":{"type":"integer"},"perPage":{"type":"integer"},"to":{"type":"integer"},"total":{"type":"integer"}},"type":"object"}},"type":"object"},"JsonApiVersion":{"properties":{"version":{"type":"string"}},"type":"object"},"JsonApiLinks":{"properties":{"first":{"type":"string"},"last":{"type":"string"},"next":{"type":"string"}},"type":"object"},"Accounts":{"properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"properties":{"primaryKey":{"title":"primaryKey","description":"This account's identifier(s) in your connected data sources. Several are joined with \", \"","type":"string"},"identifiers":{"title":"identifiers","description":"This account's identifier in each connected data source","type":"array","items":{"$ref":"#/components/schemas/AccountIdentifier"}},"name":{"title":"name","description":"Account name","type":"string"},"orgNumber":{"title":"orgNumber","description":"Organisation number","type":["string","null"]},"crmId":{"title":"crmId","description":"External CRM ID, for example from Hubspot","type":["string","null"]},"erpId":{"title":"erpId","description":"External ERP ID, for example from Fortnox","type":["string","null"]},"country":{"title":"country","description":"Primary country this account belongs to","type":["string","null"]},"parentAccountId":{"title":"parentAccountId","description":"Account ID (parent) that this account belongs to","type":["integer","null"]},"tags":{"title":"tags","description":"Tags applied to this account","type":"array","items":{"$ref":"#/components/schemas/AccountTag"}},"createdAt":{"title":"createdAt","type":"string","format":"date-time"},"updatedAt":{"title":"updatedAt","type":"string","format":"date-time"},"isGroup":{"title":"isGroup","description":"Is this a group account?","type":"boolean"},"belongsToGroup":{"title":"belongsToGroup","description":"Does this account belong to a group account?","type":"boolean"},"isArchived":{"title":"isArchived","description":"Has this account been archived?","type":"boolean"},"isActive":{"title":"isActive","description":"Is this account active?","type":"boolean"},"isPending":{"title":"isPending","description":"Is this account pending creation?","type":"boolean"},"stats":{"$ref":"#/components/schemas/AccountStats","description":"Account financial statistics, these will be variable length arrays where each item represents the value at a month and the last item of the array represents the value at the previous month (now -1 month)"},"projectedStats":{"$ref":"#/components/schemas/AccountProjectedStats","description":"Projected account financial statistics, these are monthly arrays extending 24 months ahead where the first item represents the value at the current month"}},"type":"object"},"relationships":{"$ref":"#/components/schemas/AccountsRelationships"},"links":{"$ref":"#/components/schemas/JsonApiLinksSingle"}},"type":"object"},"AccountIdentifier":{"properties":{"connector_id":{"title":"connector_id","description":"The connector (data source) this identifier belongs to","type":"integer"},"value":{"title":"value","description":"The account's identifier in that data source","type":"string"}},"type":"object"},"AccountTag":{"properties":{"name":{"title":"name","description":"Tag name","type":"string"}},"type":"object"},"AccountStats":{"properties":{"mrr_committed_fees":{"type":"array","items":{"type":"number"}},"mrr_usage_fees":{"type":"array","items":{"type":"number"}},"mrr_one_time_fees":{"type":"array","items":{"type":"number"}},"historical_cmrr":{"description":"Contracted MRR (CMRR): recurring revenue on a contracted basis, including signed subscriptions and scheduled changes that are not yet billing. Contracted ARR = historical_cmrr * 12","type":"array","items":{"type":"number"}},"billings_committed_fees":{"type":"array","items":{"type":"number"}},"billings_usage_fees":{"type":"array","items":{"type":"number"}},"billings_one_time_fees":{"type":"array","items":{"type":"number"}}},"type":"object"},"AccountProjectedStats":{"properties":{"projected_mrr_committed_fees":{"description":"Projected committed (fixed-fee) MRR, the first item represents the current month","type":"array","items":{"type":"number"}},"projected_cmrr":{"description":"Projected contracted MRR (CMRR), the first item represents the current month. Contracted ARR = projected_cmrr * 12","type":"array","items":{"type":"number"}}},"type":"object"},"AccountsRelationships":{"properties":{"subscriptions":{"type":"string"},"invoices":{"type":"string"}},"type":"object"},"JsonApiLinksSingle":{"properties":{"self":{"type":"string"}},"type":"object"},"JsonApiErrors":{"properties":{"detail":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"}},"type":"object"}}},"paths":{"/api/c1/accounts":{"get":{"tags":["Accounts"],"summary":"Get all accounts","operationId":"getAccounts","parameters":[{"name":"page","in":"query","description":"Pagination number and size","required":false,"style":"deepObject","explode":true,"schema":{"properties":{"size":{"description":"Number of objects returned per page","type":"integer"},"number":{"description":"Page number","type":"integer"}},"type":"object"}},{"name":"Accept","in":"header","description":"The client must specify an Accept header.","required":true,"schema":{"type":"string","enum":["application/vnd.api+json"]}},{"name":"filter","in":"query","description":"Filter to use","required":false,"style":"deepObject","explode":true,"schema":{"properties":{"parentAccountId":{"description":"Get all accounts where parent account ID is ..","type":"integer"},"primaryKey":{"description":"Get all accounts where primary key is ..","type":"string"},"active":{"description":"Get only active accounts","type":"boolean"},"archived":{"description":"Get only archived accounts","type":"boolean"},"pending":{"description":"Get only pending accounts","type":"boolean"}},"type":"object"}}],"responses":{"200":{"description":"OK","content":{"application/vnd.api+json":{"schema":{"properties":{"meta":{"$ref":"#/components/schemas/JsonApiMeta"},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"links":{"$ref":"#/components/schemas/JsonApiLinks"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Accounts"}}},"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/vnd.api+json":{"schema":{"properties":{"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/JsonApiErrors"}}},"type":"object"}}}}}}}}}
```

## GET /api/c1/accounts/{accountId}

> Get specific account

```json
{"openapi":"3.1.0","info":{"title":"Plock external API","version":"0.2.1"},"tags":[{"name":"Accounts","description":"Accounts"}],"servers":[{"url":"https://api.plock.io","description":"Production"},{"url":"https://test-api.plock.io","description":"Test"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"JsonApiVersion":{"properties":{"version":{"type":"string"}},"type":"object"},"JsonApiLinksSingle":{"properties":{"self":{"type":"string"}},"type":"object"},"Accounts":{"properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"properties":{"primaryKey":{"title":"primaryKey","description":"This account's identifier(s) in your connected data sources. Several are joined with \", \"","type":"string"},"identifiers":{"title":"identifiers","description":"This account's identifier in each connected data source","type":"array","items":{"$ref":"#/components/schemas/AccountIdentifier"}},"name":{"title":"name","description":"Account name","type":"string"},"orgNumber":{"title":"orgNumber","description":"Organisation number","type":["string","null"]},"crmId":{"title":"crmId","description":"External CRM ID, for example from Hubspot","type":["string","null"]},"erpId":{"title":"erpId","description":"External ERP ID, for example from Fortnox","type":["string","null"]},"country":{"title":"country","description":"Primary country this account belongs to","type":["string","null"]},"parentAccountId":{"title":"parentAccountId","description":"Account ID (parent) that this account belongs to","type":["integer","null"]},"tags":{"title":"tags","description":"Tags applied to this account","type":"array","items":{"$ref":"#/components/schemas/AccountTag"}},"createdAt":{"title":"createdAt","type":"string","format":"date-time"},"updatedAt":{"title":"updatedAt","type":"string","format":"date-time"},"isGroup":{"title":"isGroup","description":"Is this a group account?","type":"boolean"},"belongsToGroup":{"title":"belongsToGroup","description":"Does this account belong to a group account?","type":"boolean"},"isArchived":{"title":"isArchived","description":"Has this account been archived?","type":"boolean"},"isActive":{"title":"isActive","description":"Is this account active?","type":"boolean"},"isPending":{"title":"isPending","description":"Is this account pending creation?","type":"boolean"},"stats":{"$ref":"#/components/schemas/AccountStats","description":"Account financial statistics, these will be variable length arrays where each item represents the value at a month and the last item of the array represents the value at the previous month (now -1 month)"},"projectedStats":{"$ref":"#/components/schemas/AccountProjectedStats","description":"Projected account financial statistics, these are monthly arrays extending 24 months ahead where the first item represents the value at the current month"}},"type":"object"},"relationships":{"$ref":"#/components/schemas/AccountsRelationships"},"links":{"$ref":"#/components/schemas/JsonApiLinksSingle"}},"type":"object"},"AccountIdentifier":{"properties":{"connector_id":{"title":"connector_id","description":"The connector (data source) this identifier belongs to","type":"integer"},"value":{"title":"value","description":"The account's identifier in that data source","type":"string"}},"type":"object"},"AccountTag":{"properties":{"name":{"title":"name","description":"Tag name","type":"string"}},"type":"object"},"AccountStats":{"properties":{"mrr_committed_fees":{"type":"array","items":{"type":"number"}},"mrr_usage_fees":{"type":"array","items":{"type":"number"}},"mrr_one_time_fees":{"type":"array","items":{"type":"number"}},"historical_cmrr":{"description":"Contracted MRR (CMRR): recurring revenue on a contracted basis, including signed subscriptions and scheduled changes that are not yet billing. Contracted ARR = historical_cmrr * 12","type":"array","items":{"type":"number"}},"billings_committed_fees":{"type":"array","items":{"type":"number"}},"billings_usage_fees":{"type":"array","items":{"type":"number"}},"billings_one_time_fees":{"type":"array","items":{"type":"number"}}},"type":"object"},"AccountProjectedStats":{"properties":{"projected_mrr_committed_fees":{"description":"Projected committed (fixed-fee) MRR, the first item represents the current month","type":"array","items":{"type":"number"}},"projected_cmrr":{"description":"Projected contracted MRR (CMRR), the first item represents the current month. Contracted ARR = projected_cmrr * 12","type":"array","items":{"type":"number"}}},"type":"object"},"AccountsRelationships":{"properties":{"subscriptions":{"type":"string"},"invoices":{"type":"string"}},"type":"object"},"JsonApiErrors":{"properties":{"detail":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"}},"type":"object"}}},"paths":{"/api/c1/accounts/{accountId}":{"get":{"tags":["Accounts"],"summary":"Get specific account","operationId":"getAccountById","parameters":[{"name":"accountId","in":"path","description":"Plock account ID","required":true,"schema":{"type":"integer"}},{"name":"page","in":"query","description":"Pagination number and size","required":false,"style":"deepObject","explode":true,"schema":{"properties":{"size":{"description":"Number of objects returned per page","type":"integer"},"number":{"description":"Page number","type":"integer"}},"type":"object"}},{"name":"Accept","in":"header","description":"The client must specify an Accept header.","required":true,"schema":{"type":"string","enum":["application/vnd.api+json"]}}],"responses":{"200":{"description":"OK","content":{"application/vnd.api+json":{"schema":{"properties":{"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"links":{"$ref":"#/components/schemas/JsonApiLinksSingle"},"data":{"$ref":"#/components/schemas/Accounts"}},"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/vnd.api+json":{"schema":{"properties":{"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/JsonApiErrors"}}},"type":"object"}}}},"404":{"description":"Not found","content":{"application/vnd.api+json":{"schema":{"properties":{"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/JsonApiErrors"}}},"type":"object"}}}}}}}}}
```
