# Create a claim (/docs/apis/management/resources/CreateClaimResource)

`POST /resources/claim_resources`

Creates a new claim that may be referenced by identity scopes to control inclusion in tokens and `UserInfo` responses.

Base URL: `https://{tenant}.{region}.monocloud.com/api`, where `{tenant}`, `{region}` (one of us, eu, in) come from your tenant. Authentication: send your Management API key in the `X-API-KEY` header.

## Request body

JSON, required. The request payload used to create a claim.

- `display_name` (string) Human-readable display name for the resource.
- `description` (string) Description that explains the purpose of the resource.
- `show_in_discovery_document` (boolean, default true) Indicates whether this resource is advertised via the discovery document.
- `name` (string, required) The unique name of the claim.
- `source` (string, required) Specifies the expression or attribute path used to derive the claim value from the user profile or identity context.

## Response body

`201`, JSON. The claim was created successfully

Returns `ClaimResource`.

- `id` (string, required) The unique identifier of the resource.
- `display_name` (string) Human-readable display name for the resource.
- `description` (string) Description that explains the purpose of the resource.
- `show_in_discovery_document` (boolean, required) Indicates whether this resource is advertised via the discovery document.
- `creation_time` (integer, required, date-time) Specifies the creation time of the resource (in Epoch).
- `last_updated` (integer, required, date-time) Specifies the last update time of the resource (in Epoch).
- `name` (string, required) The unique name of the claim.
- `source` (string, required) Specifies the expression or attribute path used to derive the claim value from the user profile or identity context.
- `is_default` (boolean, required) Indicates whether this claim is a built-in (system-defined) claim.

## Errors

- `400` Bad Request
  - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
  - `title` (string, required) A short, human-readable summary of the error.
  - `status` (integer, required, int32) The HTTP status code associated with this error response.
  - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
  - `detail` (string) A human-readable explanation specific to this occurrence of the error.
  - `instance` (string) A URI reference that identifies the specific occurrence of the error.
- `401` Unauthorized
- `403` Forbidden
- `422` Unprocessable Entity
  - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
  - `title` (string, required) A short, human-readable summary of the error.
  - `status` (integer, required, int32) The HTTP status code associated with this error response.
  - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
  - `detail` (string) A human-readable explanation specific to this occurrence of the error.
  - `instance` (string) A URI reference that identifies the specific occurrence of the error.
  - `errors` (Record<string, string[]>, required) A key-value map of validation errors, where each key represents a request field and the value contains one or more messages describing why the request could not be processed.

## Example (MonoCloud .NET SDK)

```csharp
using MonoCloud.Management;
using MonoCloud.Management.Models;
using MonoCloud.Management.Core.Base;

var apiClient = new MonoCloudManagementClient(new MonoCloudConfig("<your-domain>", "[[API-Key]]"));


var requestBody = new CreateClaimResourceRequest
  {
    DisplayName = "Designation",
    Description = "Current position in the employed organization",
    ShowInDiscoveryDocument = true,
    Name = "designation",
    Source = "claims.first_name",
  };


var result = await apiClient.Resources.CreateClaimResourceAsync(requestBody);
```

## Example (MonoCloud Javascript SDK)

```javascript
import { MonoCloudManagementClient } from '@monocloud/management';

const apiClient = MonoCloudManagementClient.init({ domain: '<your-domain>', apiKey: '[[API-Key]]' });

const requestBody = {
  display_name: 'Designation',
  description: 'Current position in the employed organization',
  show_in_discovery_document: true,
  name: 'designation',
  source: 'claims.first_name'
};

const result = apiClient.resources.createClaimResource(requestBody);
```