> For the complete documentation index, see [llms.txt](https://docs.decisionrules.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decisionrules.io/doc/api/api-keys/enterprise-oauth-m2m/custom-claims-format.md).

# Custom Claims Format

### Creating the Custom Scope Claim for DecisionRules Solver API

To correctly set up the **OAuth M2M flow**, the Access Token must contain a custom scope claim that specifically identifies the organization, space, and target API (Solver) the client is authorized to access.

This claim ensures the token is restricted and valid only for the intended resources within your DecisionRules instance.

{% hint style="success" %}
First OAuth setup is done with the deployment with **DecisionRules Engineers.**&#x20;
{% endhint %}

#### Custom Scope Format

The required format for the custom scope claim is a colon-separated string that must start with `decisionrules`.

**The structure is as follows:**

$$\text{decisionrules}:\text{orgid}:\langle\text{Organization ID}\rangle:\text{spaceid}:\langle\text{Space ID}\rangle:\langle\text{scope}\rangle$$

**example:**

`decisionrules:orgid:12b057b4-865b-4545-81c4-8899d1da3537:spaceid:8ba6bac9-08a8-e648-8a2c-0b3992a9b4d6:solver`

| **Component**       | **Description**                                                | **Example Value**                                                          |
| ------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `decisionrules`     | Mandatory prefix indicating the target service.                | `decisionrules`                                                            |
| `orgid`             | Fixed identifier for the Organization ID key.                  | `orgid`                                                                    |
| `<Organization ID>` | The unique identifier of your DecisionRules Organization.      | `12b057b4-865b-4545-81c4-8899d1da3537`                                     |
| `spaceid`           | Fixed identifier for the Space ID key.                         | `spaceid`                                                                  |
| `<Space ID>`        | The unique identifier of the Space within the Organization.    | `8ba6bac9-08a8-e648-8a2c-0b3992a9b4d6`                                     |
| `scope`             | The specific API resource scope you are authorizing access to. | <p>Currently only supported scope is <code>solver</code> </p><p>      </p> |
|                     |                                                                |                                                                            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decisionrules.io/doc/api/api-keys/enterprise-oauth-m2m/custom-claims-format.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
