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

# Retrieve a workspace

> Retrieve a workspace for the authenticated user.



## OpenAPI

````yaml get /workspaces/{idOrSlug}
openapi: 3.0.3
info:
  title: Retrac API
  description: >-
    Retrac is an inventory management API for workspaces, items, locations,
    stock balances, transfers, and tags.
  version: 0.0.1
  contact:
    name: Retrac Support
    email: support@retrac.co
    url: https://api.retrac.co
servers:
  - url: https://api.retrac.co
    description: Production API
security: []
paths:
  /workspaces/{idOrSlug}:
    get:
      tags:
        - Workspaces
      summary: Retrieve a workspace
      description: Retrieve a workspace for the authenticated user.
      operationId: getWorkspace
      parameters:
        - in: path
          name: idOrSlug
          description: The ID or slug of the workspace.
          schema:
            type: string
            description: The ID or slug of the workspace.
          required: true
      responses:
        '200':
          description: The retrieved workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceSchema'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '410':
          $ref: '#/components/responses/410'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
        - token: []
components:
  schemas:
    WorkspaceSchema:
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the workspace.
        name:
          type: string
          description: The name of the workspace.
        slug:
          type: string
          description: The slug of the workspace.
        logo:
          type: string
          nullable: true
          default: null
          description: The logo of the workspace.
        usage:
          type: number
          description: The usage of the workspace.
        usageLimit:
          type: number
          description: The usage limit of the workspace.
        itemsUsage:
          type: number
          description: The items usage of the workspace.
        itemsLimit:
          type: number
          description: The items limit of the workspace.
        suppliersUsage:
          type: number
          description: The suppliers usage of the workspace.
        suppliersLimit:
          type: number
          description: The suppliers limit of the workspace.
        locationsUsage:
          type: number
          description: The locations usage of the workspace.
        locationsLimit:
          type: number
          description: The locations limit of the workspace.
        defaultLocationId:
          type: string
          nullable: true
          default: null
          description: The ID of the default 'Inventory' location.
        defaultCurrency:
          type: string
          minLength: 3
          maxLength: 3
          description: Default currency for jobs and monetary displays.
        invoiceNumberPrefix:
          type: string
          minLength: 1
          maxLength: 12
          description: Prefix used when generating invoice numbers.
        defaultTaxPercent:
          type: number
          minimum: 0
          maximum: 100
          description: Default tax rate applied when closing jobs.
        defaultTaxIncluded:
          type: boolean
          description: When true, line prices include tax; when false, tax is added on top.
        defaultInvoiceDueDays:
          type: integer
          minimum: 0
          maximum: 365
          description: >-
            Days after creation when new invoices are due by default (0 = no
            default due date).
        invoicingBusinessName:
          type: string
          nullable: true
          default: null
          description: Business name shown on invoices and estimates.
        invoicingBrandColor:
          type: string
          nullable: true
          default: null
          description: Accent color used on client-facing billing documents.
        invoicingEmail:
          type: string
          nullable: true
          default: null
          description: Contact email shown on billing documents.
        invoicingAddress:
          type: string
          nullable: true
          default: null
          description: Business address shown on billing documents.
        defaultInvoiceSourceLocationId:
          type: string
          nullable: true
          default: null
          description: Default source location when closing jobs.
        defaultTransferFromLocationId:
          type: string
          nullable: true
          default: null
          description: Default source location when creating transfers.
        defaultLocationType:
          type: string
          enum:
            - warehouse
            - van
            - truck
            - site
            - other
          description: Default type for newly created locations.
        defaultMarkupPercent:
          type: number
          nullable: true
          minimum: 0
          maximum: 1000
          description: Default markup percentage applied from unit cost to sell price.
        tagsLimit:
          type: number
          description: The tags limit of the workspace.
        usersLimit:
          type: number
          description: The users limit of the workspace.
        plan:
          type: string
          enum:
            - free
            - pro
            - business
            - advanced
            - business plus
            - business extra
            - business max
            - enterprise
          description: The plan of the workspace.
        stripeId:
          type: string
          nullable: true
          description: The Stripe ID of the workspace.
        billingCycleStart:
          type: number
          description: The date and time when the billing cycle starts for the workspace.
        createdAt:
          type: string
          description: The date and time when the workspace was created.
        trialEndsAt:
          type: string
          nullable: true
          description: When the workspace billing trial ends, if applicable.
        users:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - owner
                  - member
                  - viewer
                  - billing
                description: The role of the authenticated user in the workspace.
            required:
              - role
          description: The role of the authenticated user in the workspace.
        inviteCode:
          type: string
          nullable: true
          description: The invite code of the workspace.
        locationAccess:
          type: object
          properties:
            restricted:
              type: boolean
            locations:
              type: array
              items:
                type: object
                properties:
                  locationId:
                    type: string
                    minLength: 1
                  accessLevel:
                    type: string
                    enum:
                      - read
                      - write
                required:
                  - locationId
                  - accessLevel
          required:
            - restricted
            - locations
          description: Location access for the authenticated member.
        memberPermissions:
          type: object
          properties:
            capabilities:
              type: object
              additionalProperties:
                type: boolean
            profile:
              type: object
              properties:
                builtinTemplateKey:
                  type: string
                  nullable: true
                customTemplateId:
                  type: string
                  nullable: true
                customTemplateName:
                  type: string
                  nullable: true
                overrideCount:
                  type: number
                permissionsManaged:
                  type: boolean
                legacyUnrestricted:
                  type: boolean
              required:
                - builtinTemplateKey
                - customTemplateId
                - customTemplateName
                - overrideCount
                - permissionsManaged
                - legacyUnrestricted
          required:
            - capabilities
            - profile
          description: Effective member capabilities for the authenticated user.
        ssoEmailDomain:
          type: string
          nullable: true
        ssoEnforcedAt:
          type: string
          nullable: true
      required:
        - id
        - name
        - slug
        - logo
        - usage
        - usageLimit
        - itemsUsage
        - itemsLimit
        - suppliersUsage
        - suppliersLimit
        - locationsUsage
        - locationsLimit
        - defaultLocationId
        - defaultCurrency
        - invoiceNumberPrefix
        - defaultTaxPercent
        - defaultTaxIncluded
        - defaultInvoiceDueDays
        - invoicingBusinessName
        - invoicingBrandColor
        - invoicingEmail
        - invoicingAddress
        - defaultInvoiceSourceLocationId
        - defaultTransferFromLocationId
        - defaultLocationType
        - defaultMarkupPercent
        - tagsLimit
        - usersLimit
        - plan
        - stripeId
        - billingCycleStart
        - createdAt
        - trialEndsAt
        - users
        - inviteCode
        - ssoEmailDomain
        - ssoEnforcedAt
      title: Workspace
  responses:
    '400':
      description: >-
        The server cannot or will not process the request due to something that
        is perceived to be a client error (e.g., malformed request syntax,
        invalid request message framing, or deceptive request routing).
      content:
        application/json:
          schema:
            x-speakeasy-name-override: BadRequest
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - bad_request
                    description: A short code indicating the error code returned.
                    example: bad_request
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#bad-request
                required:
                  - code
                  - message
            required:
              - error
    '401':
      description: >-
        Although the HTTP standard specifies "unauthorized", semantically this
        response means "unauthenticated". That is, the client must authenticate
        itself to get the requested response.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: Unauthorized
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unauthorized
                    description: A short code indicating the error code returned.
                    example: unauthorized
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#unauthorized
                required:
                  - code
                  - message
            required:
              - error
    '403':
      description: >-
        The client does not have access rights to the content; that is, it is
        unauthorized, so the server is refusing to give the requested resource.
        Unlike 401 Unauthorized, the client's identity is known to the server.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: Forbidden
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - forbidden
                    description: A short code indicating the error code returned.
                    example: forbidden
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#forbidden
                required:
                  - code
                  - message
            required:
              - error
    '404':
      description: The server cannot find the requested resource.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: NotFound
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - not_found
                    description: A short code indicating the error code returned.
                    example: not_found
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#not-found
                required:
                  - code
                  - message
            required:
              - error
    '409':
      description: >-
        This response is sent when a request conflicts with the current state of
        the server.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: Conflict
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - conflict
                    description: A short code indicating the error code returned.
                    example: conflict
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#conflict
                required:
                  - code
                  - message
            required:
              - error
    '410':
      description: >-
        This response is sent when the requested content has been permanently
        deleted from server, with no forwarding address.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: InviteExpired
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - invite_expired
                    description: A short code indicating the error code returned.
                    example: invite_expired
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#invite-expired
                required:
                  - code
                  - message
            required:
              - error
    '422':
      description: >-
        The request was well-formed but was unable to be followed due to
        semantic errors.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: UnprocessableEntity
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unprocessable_entity
                    description: A short code indicating the error code returned.
                    example: unprocessable_entity
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://docs.retrac.co/api-reference/errors#unprocessable-entity
                required:
                  - code
                  - message
            required:
              - error
    '429':
      description: >-
        The user has sent too many requests in a given amount of time ("rate
        limiting")
      content:
        application/json:
          schema:
            x-speakeasy-name-override: RateLimitExceeded
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - rate_limit_exceeded
                    description: A short code indicating the error code returned.
                    example: rate_limit_exceeded
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://docs.retrac.co/api-reference/errors#rate-limit_exceeded
                required:
                  - code
                  - message
            required:
              - error
    '500':
      description: The server has encountered a situation it does not know how to handle.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: InternalServerError
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - internal_server_error
                    description: A short code indicating the error code returned.
                    example: internal_server_error
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://docs.retrac.co/api-reference/errors#internal-server_error
                required:
                  - code
                  - message
            required:
              - error
  securitySchemes:
    token:
      type: http
      description: >-
        Bearer API key from Settings → API Keys. Use restricted keys (prefix
        `retrac_`) with the minimum scopes required.
      scheme: bearer
      bearerFormat: API key

````