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

# Retrieve workspace

> Retrieve a workspace by its ID.



## OpenAPI

````yaml get /workspaces/{workspaceId}
openapi: 3.0.3
info:
  contact:
    email: support@openlayer.com
    name: Openlayer
    url: https://openlayer.com/
  description: API for interacting with the Openlayer server.
  title: Openlayer API
  version: '1.0'
  x-logo:
    url: https://logo.clearbit.com/openlayer.com
servers:
  - url: https://api.openlayer.com/v1
    description: Our prod backend
security:
  - bearerAuth: []
paths:
  /workspaces/{workspaceId}:
    get:
      summary: Retrieve a workspace by its ID.
      description: Retrieve a workspace by its ID.
      operationId: getWorkspaceById
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      responses:
        '200':
          description: Response OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workspace'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: >
            from openlayer import Openlayer


            client = Openlayer()

            client.workspaces.retrieve(workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
        - lang: typescript
          source: >
            import Openlayer from 'openlayer';


            const openlayer = new Openlayer();

            await openlayer.workspaces.retrieve({workspaceId:
            "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"})
        - lang: go
          source: >
            package main


            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )


            client := openlayer.NewClient()

            lient.Workspaces.Get(context.TODO(),
            "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.WorkspaceGetParams;
            import com.openlayer.api.models.WorkspaceGetResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            WorkspaceGetParams params = WorkspaceGetParams.builder().build();
            WorkspaceGetResponse response = client.workspaces().get(params);
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --header 'Authorization: Bearer <token>'
components:
  parameters:
    workspaceId:
      name: workspaceId
      in: path
      description: The workspace id.
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    Workspace:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The workspace id.
          readOnly: true
        name:
          type: string
          maxLength: 80
          example: Openlayer
          description: The workspace name.
        slug:
          type: string
          maxLength: 32
          example: openlayer
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          description: The workspace slug.
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The workspace creation date.
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The workspace last updated date.
        creatorId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The workspace creator id.
        inviteCode:
          type: string
          nullable: false
          writeOnly: true
          description: The workspace invite code.
        wildcardDomains:
          type: array
          items:
            type: string
        projectCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of projects in the workspace.
        memberCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of members in the workspace.
        monthlyUsage:
          type: array
          readOnly: true
          items:
            type: object
            properties:
              monthYear:
                type: string
                format: date
              predictionCount:
                type: integer
                minimum: 0
              executionTimeMs:
                type: integer
                nullable: true
                minimum: 0
        inviteCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of invites in the workspace.
        periodStartDate:
          type: string
          nullable: true
          format: date-time
          readOnly: true
          description: The start date of the current billing period.
        periodEndDate:
          type: string
          nullable: true
          format: date-time
          readOnly: true
          description: The end date of the current billing period.
        samlOnlyAccess:
          type: boolean
          description: Whether the workspace only allows SAML authentication.
        status:
          type: string
          enum:
            - active
            - past_due
            - unpaid
            - canceled
            - incomplete
            - incomplete_expired
            - trialing
            - paused
          readOnly: true
      required:
        - id
        - name
        - slug
        - dateCreated
        - dateUpdated
        - creatorId
        - projectCount
        - memberCount
        - inviteCount
        - periodStartDate
        - periodEndDate
        - status
  responses:
    UnexpectedError:
      description: Unexpected error.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - error
            properties:
              code:
                type: integer
                format: int32
              error:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your workspace API key. See [Find your API
        key](https://www.openlayer.com/docs/workspace-and-projects/find-your-api-key)
        for more information.

````