Browse Developer Tooling

beta · api · 0.1.0

Consume a resource-bound browser grant

POST /api/v1/browser-resource-grants/consume

Capability Domain: Developer Tooling

Authentication

No authentication required

Scope: None

Parameters and request body

  • X-Correlation-ID — header, optional
    X-Correlation-ID schema
    {
        "type": "string",
        "format": "uuid"
    }
  • Origin — header, required
    Origin schema
    {
        "type": "string",
        "format": "uri"
    }

Request schema

application/json

application/json request schema
{
    "type": "object",
    "additionalProperties": false,
    "required": [
        "token",
        "project_client_id",
        "resource_type",
        "resource_id",
        "action"
    ],
    "properties": {
        "token": {
            "type": "string",
            "minLength": 64,
            "maxLength": 64
        },
        "project_client_id": {
            "type": "string",
            "format": "uuid"
        },
        "resource_type": {
            "type": "string",
            "maxLength": 120
        },
        "resource_id": {
            "type": "string",
            "maxLength": 255
        },
        "action": {
            "type": "string",
            "maxLength": 120
        }
    }
}

application/json request example

application/json request example
{
    "token": "0000000000000000000000000000000000000000000000000000000000000000",
    "project_client_id": "40000000-0000-4000-8000-000000000004",
    "resource_type": "article",
    "resource_id": "article-42",
    "action": "comments:read"
}

Responses and errors

StatusDescription
200Authorized resource context
401Invalid or revoked Project Credential
422Request violates the public contract

200 schema

200 response schema
{
    "type": "object",
    "required": [
        "data"
    ],
    "properties": {
        "data": {
            "type": "object",
            "required": [
                "project_client_id",
                "platform_account_id",
                "resource_type",
                "resource_id",
                "action"
            ],
            "properties": {
                "project_client_id": {
                    "type": "string",
                    "format": "uuid"
                },
                "platform_account_id": {
                    "type": "string",
                    "format": "uuid"
                },
                "resource_type": {
                    "type": "string"
                },
                "resource_id": {
                    "type": "string"
                },
                "action": {
                    "type": "string"
                }
            }
        }
    }
}

401 schema

401 response schema
{
    "type": "object",
    "required": [
        "error"
    ],
    "properties": {
        "error": {
            "type": "object",
            "required": [
                "code",
                "message",
                "retryable",
                "correlation_id",
                "details"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "retryable": {
                    "type": "boolean"
                },
                "correlation_id": {
                    "type": "string",
                    "format": "uuid"
                },
                "details": {
                    "type": "object"
                }
            }
        }
    }
}

422 schema

422 response schema
{
    "type": "object",
    "required": [
        "error"
    ],
    "properties": {
        "error": {
            "type": "object",
            "required": [
                "code",
                "message",
                "retryable",
                "correlation_id",
                "details"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "retryable": {
                    "type": "boolean"
                },
                "correlation_id": {
                    "type": "string",
                    "format": "uuid"
                },
                "details": {
                    "type": "object"
                }
            }
        }
    }
}

200 example

200 response example
{
    "data": {
        "project_client_id": "40000000-0000-4000-8000-000000000004",
        "platform_account_id": "30000000-0000-4000-8000-000000000003",
        "resource_type": "article",
        "resource_id": "article-42",
        "action": "comments:read"
    }
}

Idempotency

A successful request consumes the grant; every replay fails closed.