# Search person roles

Find people by name and read their roles in the Norwegian company register. Optionally restrict returned roles to one company; names alone do not establish identity.

POST https://api.brigg.app/v1/operations/customers.SearchPersonRoles

## Access & visibility

Allow `customers.SearchPersonRoles` on your API key.

**Workspace access by default.** Private member data requires [approved member delegation](https://developer.brigg.app/authentication#member-delegation) through `Brigg-Act-As`; the key supplies permissions while private ownership and project boundaries remain enforced.

[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 |
| --- | --- | --- | --- |
| `name` | string | Yes | Case-insensitive name substring in the Norwegian company index, for example Kari Nordmann. This searches registered role holders, not your workspace's Person records. At least 2 characters. At most 200 characters. |
| `org_number` | string | No | Nine-digit Norwegian organization number. Restricts returned roles to that company; a Brigg Company record ID is not accepted. Pattern: `^\d{9}$`. |

## Verify a registry match before using it

This reads Brigg's index of the Norwegian company register, not the workspace contact list. Data reflects the index's most recent import and is not a live identity verification. Names are not unique: compare the reported name, birth date when available, organization number and role. A null birth date is unknown, not a mismatch.

The call selects up to ten matching people before restricting their roles to org_number. An empty result therefore does not prove a person holds no role. Use a more specific name and [Get indexed company](https://developer.brigg.app/reference/customers/GetIndexedCompany) to inspect one company's indexed roles. There is no paging parameter for this operation. Use [List people](https://developer.brigg.app/reference/customers/ListPeople) when looking for your own customer contacts.

## Response

Returns **200 OK** with a JSON body.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `roles` | array of [PersonRegistryRoles](#personregistryroles-response-roles) | Yes | Up to ten name-matching people, ordered by name similarity, with their registered roles. A company filter removes people without a matching role; there is no cursor or exhaustive-search guarantee. |

### PersonRegistryRoles · response.roles[]

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `person_key` | string | Yes | Opaque register-person key. Keep it for comparing hits; it is not a Brigg Person ID or a government identity number. |
| `full_name` | string | Yes | Full name reported for this person. |
| `birth_date` | null or string | Yes | Birth date in YYYY-MM-DD format, or null when the source register does not supply one. A name match alone does not establish identity. |
| `roles` | array of [object](#response-roles-roles) | Yes | Roles held by this person in the indexed register, optionally restricted to org_number. Can be empty without a company filter. |

### response.roles[].roles[]

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `org_number` | string | Yes | Official organization number as text; preserve leading zeros. |
| `company_name` | null or string | Yes | Registered company name. |
| `role_group` | string | Yes | Norwegian register role group, for example STYR (board) or DAGL (general management). Preserve unknown source codes. |
| `role_code` | string | Yes | Norwegian register role code, for example LEDE (board chair), MEDL (board member), VARA (deputy board member) or DAGL (general manager). This response does not include a separate display label; preserve unknown codes. |
| `resigned` | boolean | Yes | Whether the register reports this role as resigned. Allowed: `false`, `true`. |

## 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. If Brigg-Act-As is supplied, the key must be authorized to delegate to that member. |
| 404 | `not_found` | The requested operation or resource is not available to this credential. |
| 429 | `rate_limited` | Wait for Retry-After before retrying. |

## Next steps

- [Get indexed company](https://developer.brigg.app/reference/customers/GetIndexedCompany)
- [Search company index](https://developer.brigg.app/reference/customers/SearchCompanyIndex)
- [List people](https://developer.brigg.app/reference/customers/ListPeople)

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

## Examples

### Find a person's role in one company

Names, dates and organization numbers below are fictional. Check the returned role instead of trusting the name alone.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/customers.SearchPersonRoles' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "Kari Nordmann",
  "org_number": "999999999"
}'
```

#### TypeScript


```typescript
const response = await fetch("https://api.brigg.app/v1/operations/customers.SearchPersonRoles", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Kari Nordmann",
    "org_number": "999999999"
  }),
});
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 = {
  "name": "Kari Nordmann",
  "org_number": "999999999"
}
request = Request(
    "https://api.brigg.app/v1/operations/customers.SearchPersonRoles",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
    },
    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
{
  "roles": [
    {
      "person_key": "registry_person_kari",
      "full_name": "Kari Nordmann",
      "birth_date": "1980-04-12",
      "roles": [
        {
          "org_number": "999999999",
          "company_name": "Northstar Consulting AS",
          "role_group": "STYR",
          "role_code": "LEDE",
          "resigned": false
        }
      ]
    }
  ]
}
```

### No matching role returned

This is a successful lookup, not proof of absence from the registry.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/customers.SearchPersonRoles' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "Kari Nordmann",
  "org_number": "999999999"
}'
```

#### TypeScript


```typescript
const response = await fetch("https://api.brigg.app/v1/operations/customers.SearchPersonRoles", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Kari Nordmann",
    "org_number": "999999999"
  }),
});
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 = {
  "name": "Kari Nordmann",
  "org_number": "999999999"
}
request = Request(
    "https://api.brigg.app/v1/operations/customers.SearchPersonRoles",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
    },
    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
{
  "roles": []
}
```

## JSON schemas


```json-schema-request
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 2,
      "maxLength": 200,
      "description": "Case-insensitive name substring in the Norwegian company index, for example Kari Nordmann. This searches registered role holders, not your workspace's Person records."
    },
    "org_number": {
      "type": "string",
      "pattern": "^\\d{9}$",
      "description": "Nine-digit Norwegian organization number. Restricts returned roles to that company; a Brigg Company record ID is not accepted."
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "name": "Kari Nordmann",
      "org_number": "999999999"
    }
  ]
}
```


```json-schema-response
{
  "type": "object",
  "properties": {
    "roles": {
      "type": "array",
      "items": {
        "title": "PersonRegistryRoles",
        "type": "object",
        "properties": {
          "person_key": {
            "type": "string",
            "description": "Opaque register-person key. Keep it for comparing hits; it is not a Brigg Person ID or a government identity number."
          },
          "full_name": {
            "type": "string",
            "description": "Full name reported for this person."
          },
          "birth_date": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Birth date in YYYY-MM-DD format, or null when the source register does not supply one. A name match alone does not establish identity."
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "org_number": {
                  "type": "string",
                  "description": "Official organization number as text; preserve leading zeros."
                },
                "company_name": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "Registered company name."
                },
                "role_group": {
                  "type": "string",
                  "description": "Norwegian register role group, for example STYR (board) or DAGL (general management). Preserve unknown source codes."
                },
                "role_code": {
                  "type": "string",
                  "description": "Norwegian register role code, for example LEDE (board chair), MEDL (board member), VARA (deputy board member) or DAGL (general manager). This response does not include a separate display label; preserve unknown codes."
                },
                "resigned": {
                  "type": "boolean",
                  "enum": [
                    false,
                    true
                  ],
                  "description": "Whether the register reports this role as resigned."
                }
              },
              "required": [
                "org_number",
                "company_name",
                "role_group",
                "role_code",
                "resigned"
              ],
              "additionalProperties": false
            },
            "description": "Roles held by this person in the indexed register, optionally restricted to org_number. Can be empty without a company filter."
          }
        },
        "required": [
          "person_key",
          "full_name",
          "birth_date",
          "roles"
        ],
        "additionalProperties": false
      },
      "description": "Up to ten name-matching people, ordered by name similarity, with their registered roles. A company filter removes people without a matching role; there is no cursor or exhaustive-search guarantee."
    }
  },
  "required": [
    "roles"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "roles": [
        {
          "person_key": "registry_person_kari",
          "full_name": "Kari Nordmann",
          "birth_date": "1980-04-12",
          "roles": [
            {
              "org_number": "999999999",
              "company_name": "Northstar Consulting AS",
              "role_group": "STYR",
              "role_code": "LEDE",
              "resigned": false
            }
          ]
        }
      ]
    }
  ]
}
```

