# Get record

Read one record by ID, whatever its type. The response names the record's type and returns the same fields as the type's own read operation. Missing, deleted and inaccessible records all return not_found.

POST https://api.brigg.app/v1/operations/records.GetRecord

## Access & visibility

Allow `records.GetRecord` on your API key.

**Acting member required.** Send `Brigg-Act-As` with an [approved member account ID](https://developer.brigg.app/authentication#member-delegation). The key supplies permissions; the member selects whose data is used.

The selected member must be active and approved by the credential. This selects whose private data is used; the credential supplies permissions. Private ownership and project boundaries still apply.

[Set up authentication](https://developer.brigg.app/authentication) · [Choose permissions](https://developer.brigg.app/permissions)

## Request fields

Send a JSON object with the following fields. Required fields must be included; omit optional fields you do not need.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The record's id. At least 1 character. |

## Response

Returns **200 OK** with a JSON body.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string | Yes | The qualified type the record belongs to, e.g. `core:Company`. |
| `item` | [object](#response-item) | Yes | The requested record, including its metadata and data fields. |

### response.item

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The record's stable ID. |
| `created_at` | number | Yes | Time the record was created, in Unix milliseconds. |
| `updated_at` | number | Yes | Time the record most recently changed, in Unix milliseconds. |
| `created_by` | string or null | Yes | Account that created the record, or null. |
| `private` | boolean | Yes | True when only the record's owner can see it. |
| `data` | map of JSON values | Yes | The record's fields: exactly those the type's own read operation returns, under the same names. |

## Errors & retries

This operation reads data. It needs no idempotency key and can be retried after a transient failure.

For rate limits, follow the server’s retry guidance and back off. See [HTTP errors](https://developer.brigg.app/http#errors) and [safe retries and limits](https://developer.brigg.app/reliability).

| HTTP status | Code | What to do |
| --- | --- | --- |
| 400 | `invalid_json` | Send a JSON object with Content-Type: application/json. |
| 400 | `invalid_input` | Check the request fields and types. |
| 401 | `invalid_key` | The workspace API key is missing, invalid or revoked. |
| 403 | `forbidden` | Check the key’s operation and resource grants. Supply Brigg-Act-As with a member authorized by the key’s delegation grant. The selected member must be active and approved by the credential. This selects whose private data is used; the credential supplies permissions. Private ownership and project boundaries still apply. |
| 404 | `not_found` | The record does not exist, was deleted, or is not readable with this credential and acting member. A known ID does not grant access. |
| 429 | `rate_limited` | Wait for Retry-After before retrying. |

## Next steps

[Download OpenAPI](https://developer.brigg.app/openapi.json) · [Versioning & retirement](https://developer.brigg.app/versioning)

## Examples

### Example request

Fictional values. Replace IDs and business details with values from your workspace.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/records.GetRecord' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  -H "Brigg-Act-As: $BRIGG_ACT_AS" \
  --data-raw '{
  "id": "e_company_example"
}'
```

#### TypeScript


```typescript
const actAs = process.env.BRIGG_ACT_AS;
if (!actAs) throw new Error("Set BRIGG_ACT_AS to an approved member account ID.");

const response = await fetch("https://api.brigg.app/v1/operations/records.GetRecord", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
    "Brigg-Act-As": actAs,
  },
  body: JSON.stringify({
    "id": "e_company_example"
  }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.error} — ${result.message}`);
console.log(result);
```

#### Python


```python
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError

payload = {
  "id": "e_company_example"
}
request = Request(
    "https://api.brigg.app/v1/operations/records.GetRecord",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
        "Brigg-Act-As": os.environ["BRIGG_ACT_AS"],
    },
    method="POST",
)
try:
    with urlopen(request) as response:
        print(json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))
    raise
```

#### Response example


```json
{
  "type": "core:Company",
  "item": {
    "id": "e_company_example",
    "created_at": 1794301200000,
    "updated_at": 1794301200000,
    "created_by": null,
    "private": false,
    "data": {
      "name": "Example AS",
      "city": "Oslo"
    }
  }
}
```

## JSON schemas


```json-schema-request
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "description": "The record's id."
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "id": "e_company_example"
    }
  ]
}
```


```json-schema-response
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "The qualified type the record belongs to, e.g. `core:Company`."
    },
    "item": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The record's stable ID."
        },
        "created_at": {
          "type": "number",
          "description": "Time the record was created, in Unix milliseconds."
        },
        "updated_at": {
          "type": "number",
          "description": "Time the record most recently changed, in Unix milliseconds."
        },
        "created_by": {
          "type": [
            "string",
            "null"
          ],
          "description": "Account that created the record, or null."
        },
        "private": {
          "type": "boolean",
          "description": "True when only the record's owner can see it."
        },
        "data": {
          "type": "object",
          "additionalProperties": true,
          "description": "The record's fields: exactly those the type's own read operation returns, under the same names."
        }
      },
      "required": [
        "id",
        "created_at",
        "updated_at",
        "created_by",
        "private",
        "data"
      ],
      "additionalProperties": false,
      "description": "The requested record, including its metadata and data fields."
    }
  },
  "required": [
    "type",
    "item"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "type": "core:Company",
      "item": {
        "id": "e_company_example",
        "created_at": 1794301200000,
        "updated_at": 1794301200000,
        "created_by": null,
        "private": false,
        "data": {
          "name": "Example AS",
          "city": "Oslo"
        }
      }
    }
  ]
}
```

