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

# Get the workspace of the API key

> Useful to check that a key works.



## OpenAPI

````yaml /api-reference/openapi.json get /workspace
openapi: 3.1.0
info:
  title: HocDoc API
  version: 1.0.0
  description: >-
    Read-only API for offers and their timeline.


    Send an API key as `Authorization: Bearer <key>`. A key belongs to one
    workspace and only reads its data. Create keys in the app under
    Einstellungen, Integrationen.


    Timestamps are ISO 8601 in UTC with milliseconds. Values outside the years
    0001 to 9999 are clamped to that range.


    Limits: 120 requests per minute per key and 300 requests per minute per IP
    address. See the `RateLimit-*` headers of each response.


    Compatibility: new fields, endpoints and event types may be added at any
    time, so ignore what you do not know. Breaking changes come under a new path
    (`/api/v2`).
servers:
  - url: https://app.hocdoc.com/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Workspace
    description: The workspace of the API key.
  - name: Offers
    description: Offers and their timeline.
paths:
  /workspace:
    get:
      tags:
        - Workspace
      summary: Get the workspace of the API key
      description: Useful to check that a key works.
      operationId: getWorkspace
      responses:
        '200':
          description: The workspace.
          headers:
            RateLimit-Limit:
              description: Requests allowed per window for this API key.
              required: true
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              required: true
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the current window ends.
              required: true
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceResponse'
              examples:
                workspace:
                  summary: The workspace of the key
                  value:
                    data:
                      id: 9f1c4b7e-3a52-4d86-b0c1-7e2a9d5f3c18
                      name: Example GmbH
                      timezone: Europe/Berlin
                      currency: EUR
        '400':
          description: Query string longer than 1024 characters (`invalid_request`).
          headers:
            RateLimit-Limit:
              description: >-
                Requests allowed per window for this API key. Not sent when the
                query string is too long.
              required: false
              schema:
                type: integer
            RateLimit-Remaining:
              description: >-
                Requests left in the current window. Not sent when the query
                string is too long.
              required: false
              schema:
                type: integer
            RateLimit-Reset:
              description: >-
                Seconds until the current window ends. Not sent when the query
                string is too long.
              required: false
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                query_too_long:
                  value:
                    error:
                      code: invalid_request
                      message: Query string too long.
        '401':
          description: >-
            Missing or invalid API key. The response is the same for a missing,
            malformed, unknown, revoked or expired key.
          headers:
            RateLimit-Limit:
              description: >-
                Requests allowed per window for this API key. Not sent when the
                key is missing or malformed.
              required: false
              schema:
                type: integer
            RateLimit-Remaining:
              description: >-
                Requests left in the current window. Not sent when the key is
                missing or malformed.
              required: false
              schema:
                type: integer
            RateLimit-Reset:
              description: >-
                Seconds until the current window ends. Not sent when the key is
                missing or malformed.
              required: false
              schema:
                type: integer
            WWW-Authenticate:
              description: The authentication scheme the API expects. Always `Bearer`.
              required: true
              schema:
                type: string
                examples:
                  - Bearer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  value:
                    error:
                      code: unauthorized
                      message: Missing or invalid API key.
        '405':
          description: >-
            Method not allowed. This API is read-only. Sent for `POST`, `PUT`,
            `PATCH` and `DELETE` on this path. No API key is needed and the rate
            limit headers are not sent.
          headers:
            Allow:
              description: The methods this path accepts.
              required: true
              schema:
                type: string
                examples:
                  - GET, HEAD, OPTIONS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                method_not_allowed:
                  value:
                    error:
                      code: method_not_allowed
                      message: Method not allowed. This API is read-only.
        '429':
          description: >-
            Too many requests. Either the limit per API key or the limit per IP
            address was reached.
          headers:
            RateLimit-Limit:
              description: >-
                Requests allowed per window for this API key. Not sent when the
                limit per IP address was reached.
              required: false
              schema:
                type: integer
            RateLimit-Remaining:
              description: >-
                Requests left in the current window. Not sent when the limit per
                IP address was reached.
              required: false
              schema:
                type: integer
            RateLimit-Reset:
              description: >-
                Seconds until the current window ends. Not sent when the limit
                per IP address was reached.
              required: false
              schema:
                type: integer
            Retry-After:
              required: true
              description: Seconds to wait before the next request.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                rate_limited:
                  value:
                    error:
                      code: rate_limited
                      message: Too many requests.
        '500':
          description: Internal server error.
          headers:
            RateLimit-Limit:
              description: Requests allowed per window for this API key.
              required: true
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              required: true
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the current window ends.
              required: true
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal_error:
                  value:
                    error:
                      code: internal_error
                      message: Internal server error.
components:
  schemas:
    WorkspaceResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Workspace'
      required:
        - data
      description: The workspace of the API key.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - not_found
                - invalid_request
                - method_not_allowed
                - rate_limited
                - internal_error
              description: Stable, machine-readable error code.
            message:
              type: string
              description: Human-readable message. May change, do not parse.
            param:
              description: The query parameter that was rejected.
              type: string
          required:
            - code
            - message
      required:
        - error
      description: Every error of the API has this shape.
    Workspace:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: ID of the workspace.
        name:
          type: string
          description: Name of the workspace.
        timezone:
          type: string
          description: IANA time zone.
          examples:
            - Europe/Berlin
        currency:
          type: string
          description: Default ISO 4217 currency code.
          examples:
            - EUR
      required:
        - id
        - name
        - timezone
        - currency
      description: The workspace the API key belongs to.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: API key, for example `hd_live_…`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.