Skip to main content
POST
/
v3
/
grants
Create a grant
curl --request POST \
  --url https://api.ctrl-hub.com/v3/grants \
  --header 'Content-Type: application/vnd.api+json' \
  --header 'X-Session-Token: <api-key>' \
  --data '
{
  "data": {
    "type": "<string>",
    "attributes": {
      "type": "role",
      "subject": "<string>",
      "scope": {
        "attributes": [
          {
            "name": "<string>",
            "operation": "=",
            "value": "<string>"
          }
        ],
        "patterns": [
          {
            "name": "<string>",
            "matcher": "prefix",
            "operation": "=",
            "value": "<string>"
          }
        ]
      },
      "reason": "<string>",
      "starts_at": "2023-11-07T05:31:56Z",
      "expires_at": "2023-11-07T05:31:56Z"
    },
    "relationships": {
      "organisation": {
        "data": {
          "type": "<string>",
          "id": "<string>"
        }
      }
    }
  }
}
'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "type": "<string>",
    "attributes": {
      "type": "role",
      "subject": "<string>",
      "scope": {
        "attributes": [
          {
            "name": "<string>",
            "operation": "=",
            "value": "<string>"
          }
        ],
        "patterns": [
          {
            "name": "<string>",
            "matcher": "prefix",
            "operation": "=",
            "value": "<string>"
          }
        ]
      },
      "reason": "<string>",
      "expires_at": "2023-11-07T05:31:56Z",
      "starts_at": "2023-11-07T05:31:56Z"
    },
    "meta": {
      "created_at": "2023-11-07T05:31:56Z",
      "grantee_type": "groups"
    },
    "relationships": {
      "organisation": {
        "data": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "type": "<string>"
        }
      },
      "authoriser": {
        "data": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "type": "<string>"
        }
      },
      "principal_job_role": {
        "data": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "type": "<string>"
        }
      },
      "principal_role_group": {
        "data": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "type": "<string>"
        }
      },
      "principal_service_account": {
        "data": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "type": "<string>"
        }
      },
      "principal_scheme_share": {
        "data": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "type": "<string>"
        }
      },
      "principal_team": {
        "data": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "type": "<string>"
        }
      },
      "principal_user": {
        "data": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "type": "<string>"
        }
      }
    }
  },
  "jsonapi": {
    "version": "<string>"
  },
  "included": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "type": "<string>",
      "attributes": {
        "name": "<string>",
        "slug": "<string>",
        "sandbox": true,
        "settings": {
          "nomenclature": {
            "governance": {
              "schemes": [
                {
                  "singular": "<string>",
                  "plural": "<string>",
                  "language": "<string>"
                }
              ],
              "work_orders": [
                {
                  "singular": "<string>",
                  "plural": "<string>",
                  "language": "<string>"
                }
              ],
              "operations": [
                {
                  "singular": "<string>",
                  "plural": "<string>",
                  "language": "<string>"
                }
              ]
            }
          }
        },
        "description": "<string>"
      },
      "meta": {
        "v3": true,
        "status": "active",
        "created_at": "2023-11-07T05:31:56Z",
        "updated_at": "2023-11-07T05:31:56Z",
        "features": [
          {
            "name": "<string>",
            "enabled": true,
            "limit": 123
          }
        ]
      },
      "relationships": {
        "users": {
          "data": [
            {
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "type": "<string>"
            }
          ]
        },
        "service_accounts": {
          "data": [
            {
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "type": "<string>"
            }
          ]
        },
        "groups": {
          "data": [
            {
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "type": "<string>"
            }
          ]
        },
        "teams": {
          "data": [
            {
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "type": "<string>"
            }
          ]
        }
      }
    }
  ]
}

Authorizations

X-Session-Token
string
header
required

Session token for authentication.

Body

application/vnd.api+json

The grant to create.

data
object
required

Response

Get a grant.

JSON API response object

data
object
required

A grant

jsonapi
object
required
included
object[]

Related resources that can be included when a grant is returned

An organisation