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

# Set Check Owner

Use this API to set a check's owner for a project, or to clear it with `null`. Without an owner set here, the check's owner is the default owner for its responsibility, else the project admin (see [Update Check Settings](https://velt.dev/docs/api-reference/rest-apis/v2/agents/checks/settings/update.md)). [List Checks](https://velt.dev/docs/api-reference/rest-apis/v2/agents/checks/list.md) returns both: `ownerMemberId` (set here) and `effectiveOwner` (the one that applies).

# Endpoint

`POST https://api.velt.dev/v2/agents/checks/owner/set`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**organizationId** `string` *required*

1 to 512 characters. The organization of the project.

**documentId** `string` *required*

1 to 512 characters. The document of the project.

**ruleKey** `string` *required*

The check. `[a-z0-9:-]`, at most 120 characters.

**ownerMemberId** `string | null` *required*

The owner's user id (1 to 512 characters), or `null` to clear the owner. The field must be present.

**owner** `object | null`

The owner's name and email, so they show without a lookup: `{ userId, name?, email? }`, `name` and `email` at most 512 characters each. Kept only when `owner.userId` equals `ownerMemberId`.

The schema uses `.strict()`: unknown fields, in `data` or in `owner`, are rejected.

## **Example Requests**

#### 1. Set the owner

```JSON theme={null}
{
  "data": {
    "organizationId": "org_acme",
    "documentId": "acme-marketing-site",
    "ruleKey": "link-broken",
    "ownerMemberId": "user_jordan",
    "owner": {
      "userId": "user_jordan",
      "name": "Jordan Lee",
      "email": "jordan@example.com"
    }
  }
}
```

#### 2. Clear the owner

```JSON theme={null}
{
  "data": {
    "organizationId": "org_acme",
    "documentId": "acme-marketing-site",
    "ruleKey": "link-broken",
    "ownerMemberId": null
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Check owner set",
    "data": {
      "ownerMemberId": "user_jordan"
    }
  }
}
```

| Field | Type | Description |
| - | - | - |
| `data.ownerMemberId` | string \| null | The owner now set, or `null` when cleared. |

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "Workspace not found or has no store database for the checks engine",
    "status": "NOT_FOUND",
    "details": {
      "reason": "CHECKS_WORKSPACE_NOT_FOUND"
    }
  }
}
```

**Errors:** `INVALID_ARGUMENT` (a body outside the schema: a missing or malformed `ruleKey`, a missing `ownerMemberId`, an `owner` without `userId`, or an unknown field) / `NOT_FOUND` with `CHECKS_WORKSPACE_NOT_FOUND` (the workspace has no store database).

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Check owner set",
    "data": {
      "ownerMemberId": null
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.