Access

Grant Access

Grant an access on a resource

POST
https://api.textreveal.com/v3/acl/{resource_type}/{resource_id}

Request

Parameters

  • resource_type*string (enum)

    Type of the resource the access grants apply to. Only 'universe' for now.

    Values: "universe"
  • resource_id*uuid

    Unique identifier of the universe.

    Example: "75ebc096-749e-4b8f-b690-df13daf49c62"

Request Body

  • grant_typestring (enum)

    Whether the grant targets a single user or a whole organization.

    Default: "USER"Values: "USER", "ORGANIZATION"
  • grant_id*uuid

    Identifier of the user or organization the grant targets, depending on resource_type.

    Example: "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  • access_level*string (enum)

    Level of access granted on the universe.

    Values: "OWNER", "READ_WRITE", "READ_ONLY"
Request
{
  "grant_type": "USER",
  "grant_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "access_level": "OWNER"
}

Response

Response - 201

Access successfully granted

  • acl_id*uuid

    Unique identifier of the access grant.

    Example: "9c858e93-6f36-4f3e-9c34-5f6a1a3d9b21"
  • resource_type*string (enum)

    Type of the resource the access grants apply to. Only 'universe' for now.

    Values: "universe"
  • resource_id*uuid

    Unique identifier of the universe.

    Example: "75ebc096-749e-4b8f-b690-df13daf49c62"
  • grant_type*string (enum)

    Whether the grant targets a single user or a whole organization.

    Values: "USER", "ORGANIZATION"
  • grant_id*uuid

    Identifier of the user or organization the grant targets, depending on resource_type.

    Example: "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  • access_level*string (enum)

    Level of access granted on the universe.

    Values: "OWNER", "READ_WRITE", "READ_ONLY"
  • granted_by*uuid

    Identifier of the user who created this grant.

    Example: "d290f1ee-6c54-4b01-90e6-d701748f0851"
  • granted_at*date-time

    When this grant was created.

    Example: "2024-01-01T00:00:00.000Z"
Response
{
  "acl_id": "9c858e93-6f36-4f3e-9c34-5f6a1a3d9b21",
  "resource_type": "universe",
  "resource_id": "75ebc096-749e-4b8f-b690-df13daf49c62",
  "grant_type": "USER",
  "grant_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "access_level": "OWNER",
  "granted_by": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "granted_at": "2024-01-01T00:00:00.000Z"
}

Error

Error - 400

Bad request

  • message*string

    Error message.

    Example: "Check the errors field for more details"
  • code*number (enum)

    Error code.

    Values: 400
  • reason*string (enum)

    Error reason.

    Values: "invalid"
  • errorsobject[]

    Possible error causes.

    Array length: [1, ∞]
Response
{
  "message": "Check the errors field for more details",
  "code": 400,
  "reason": "invalid",
  "errors": [
    {
      "message": "string",
      "field": "grant_type",
      "reason": "invalid_type"
    }
  ]
}

Error - 403

Forbidden

  • message*string

    Error message.

    Example: "You are not allowed to update this universe"
  • code*number (enum)

    Error code.

    Values: 403
  • reason*string (enum)

    Error reason.

    Values: "forbidden"
Response
{
  "message": "You are not allowed to update this universe",
  "code": 403,
  "reason": "forbidden"
}

Error - 404

Not found

  • message*string

    Error message.

    Example: "The requested universe does not exist or is not visible to your organization."
  • code*number (enum)

    Error code.

    Values: 404
  • reason*string (enum)

    Error reason.

    Values: "not_found"
Response
{
  "message": "The requested universe does not exist or is not visible to your organization.",
  "code": 404,
  "reason": "not_found"
}

Error - 409

Conflict

  • message*string

    Error message.

    Example: "An access grant already exists for this resource and target. Delete it first to change its access level."
  • code*number (enum)

    Error code.

    Values: 409
  • reason*string (enum)

    Error reason.

    Values: "invalid"
Response
{
  "message": "An access grant already exists for this resource and target. Delete it first to change its access level.",
  "code": 409,
  "reason": "invalid"
}

Generic errors are not shown, see Errors for more details.