> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerorank.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get workspace context

> Returns the workspace this key belongs to, the plan, the key's own scopes, and the key's rate limit. A good first call to check that a key works.



## OpenAPI

````yaml /api/openapi.json get /workspace
openapi: 3.1.0
info:
  title: ZeroRank REST API
  version: 1.0.0
  description: >-
    The public ZeroRank REST API. Every request uses a workspace API key (Bearer
    `zr_live_…`) and only ever sees that one workspace. Use it to read your
    results and manage your prompts, brands, tags, and topics from your own
    scripts and tools.
servers:
  - url: https://api.zerorank.ai/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Workspace
    description: The workspace, plan, and key behind your request.
  - name: Prompts
    description: The questions ZeroRank asks AI engines for you.
  - name: Brands
    description: The brands you track, including competitors.
  - name: Tags
    description: Labels you put on prompts.
  - name: Topics
    description: Groups you sort prompts into.
  - name: Analytics
    description: 'Read-only results: sources, chats, and rankings.'
paths:
  /workspace:
    get:
      tags:
        - Workspace
      summary: Get workspace context
      description: >-
        Returns the workspace this key belongs to, the plan, the key's own
        scopes, and the key's rate limit. A good first call to check that a key
        works.
      operationId: getWorkspace
      responses:
        '200':
          description: Workspace context.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/WorkspaceContext'
                  message:
                    type: string
                    example: Workspace retrieved successfully
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/SubscriptionRequired'
        '403':
          $ref: '#/components/responses/ApiAccessDisabled'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    WorkspaceContext:
      type: object
      properties:
        workspace:
          type: object
          properties:
            id:
              type: integer
              example: 7
            name:
              type: string
              example: Acme Marketing
        organization:
          type: object
          properties:
            plan:
              type: string
              description: The base plan name.
              example: pro
            subscriptionStatus:
              type: string
              example: active
        apiKey:
          type:
            - object
            - 'null'
          properties:
            id:
              type: integer
              example: 4
            name:
              type: string
              example: Production server
            prefix:
              type: string
              example: zr_live_a1b2c3
            last4:
              type: string
              example: 9f2e
            scopes:
              type: array
              items:
                $ref: '#/components/schemas/ApiKeyScope'
        rateLimitPerMinute:
          type: integer
          description: How many requests this key may make per minute.
          example: 120
    ApiKeyScope:
      type: string
      enum:
        - read
        - write
      description: >-
        `read` allows GET requests; `write` allows create, update, delete, and
        run.
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: A human-readable explanation.
        code:
          type: string
          description: A short error code, when one applies.
        errors:
          description: Field-level details, on validation errors.
  responses:
    Unauthorized:
      description: The API key is missing, invalid, revoked, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Invalid, revoked, or expired API key
            code: API_KEY_INVALID
    SubscriptionRequired:
      description: The workspace has no active subscription or trial.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: An active subscription or trial is required to use the API
            code: SUBSCRIPTION_REQUIRED
    ApiAccessDisabled:
      description: API access is not available on this plan.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: API access is not available on this plan
            code: API_ACCESS_DISABLED
    RateLimited:
      description: >-
        Too many requests. Slow down and retry after the time in the
        `Retry-After` header.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Your per-minute limit.
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Requests left in this window.
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Unix time when the window resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: API rate limit exceeded. Please slow down.
            code: RATE_LIMIT_EXCEEDED
            retryAfter: 30
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Send your workspace API key as `Authorization: Bearer zr_live_…`.'

````