# 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":"Your accounts primary ID","type":"string"},"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"]},"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)"}},"type":"object"},"relationships":{"$ref":"#/components/schemas/AccountsRelationships"},"links":{"$ref":"#/components/schemas/JsonApiLinksSingle"}},"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"}},"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"},"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":"Your accounts primary ID","type":"string"},"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"]},"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)"}},"type":"object"},"relationships":{"$ref":"#/components/schemas/AccountsRelationships"},"links":{"$ref":"#/components/schemas/JsonApiLinksSingle"}},"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"}},"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"},"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"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plock.io/plock-overview/use-cases/for-developers/api/endpoints/accounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
