---
title: "Connect an onboarding session to the organization of the caller"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect an onboarding session to the organization of the caller

Path: CloudRaker Workspace API › Onboarding

`POST /onboarding/sessions/{id}/claim`

Connects an onboarding session that an AI agent started to the organization of the session token. After the claim, the agent can get one credential with admin access to that organization. `organizationId` must be the organization of the session token. Authorization: a signed-in organization administrator only (denied, 403).

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `id` (`claimOnboardingSession.path.id`; string, required)

## Request body

_Required._

- `organizationId` (`claimOnboardingSession.organizationId`; string, required) — The organization that the claim page showed. It must be the organization of the session token.
  - minLength 1; maxLength 100; example `"org_01H8ZK"`

## Example request

```json
{
  "organizationId": "org_01H8ZK"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/onboarding/sessions/<id>/claim' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "organizationId": "org_01H8ZK"
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/onboarding/sessions/<id>/claim';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({organizationId: 'org_01H8ZK'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/onboarding/sessions/<id>/claim"

payload = { "organizationId": "org_01H8ZK" }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The session belongs to the organization now.

#### Example

```json
{
  "claimed": true,
  "organizationId": "string"
}
```

- `claimed` (`claimOnboardingSession.response.200.claimed`; boolean, required)
- `organizationId` (`claimOnboardingSession.response.200.organizationId`; string, required) — The organization that the session belongs to.

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`claimOnboardingSession.response.400.success`; boolean, required)
  - one of `false`
- `error` (`claimOnboardingSession.response.400.error`; array<unknown>, required)
- `data` (`claimOnboardingSession.response.400.data`; unknown, required)

### 403

`session_required`: the caller is not a signed-in person. `forbidden`: the caller is not an administrator of the organization.

### 404

`session_not_found`: the session does not exist or it expired.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`claimOnboardingSession.response.404.error`; string, required) — The error code.
- `message` (`claimOnboardingSession.response.404.message`; string, required) — The sentence a person reads.

### 409

`organization_changed`: `organizationId` is not the organization of the session token. `session_claimed_elsewhere`: another organization or another person already claimed the session.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`claimOnboardingSession.response.409.error`; string, required) — The error code.
- `message` (`claimOnboardingSession.response.409.message`; string, required) — The sentence a person reads.

### 429

`rate_limited`: too many claims. Wait one minute.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`claimOnboardingSession.response.429.error`; string, required) — The error code.
- `message` (`claimOnboardingSession.response.429.message`; string, required) — The sentence a person reads.

### 503

`onboarding_unavailable`: the onboarding service did not answer.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`claimOnboardingSession.response.503.error`; string, required) — The error code.
- `message` (`claimOnboardingSession.response.503.message`; string, required) — The sentence a person reads.


Source: https://docs.cloudraker.com/workspace/api/onboarding/claim-onboarding-session/index.md
