> ## 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.

# Update workspace

> Update a workspace.



## OpenAPI

````yaml put /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}:
    put:
      summary: Update a workspace.
      description: Update a workspace.
      operationId: updateWorkspaceById
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name: a9b16d0f-b02b-4c41-9047-ece5aaf0bfd2
                slug: c6b87ac4-b677-4607-8504-6d814e2dc615
                inviteCode: 27d17236-66f5-4af0-8a1b-9a972eb00573
      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.update(
              workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              name="My Workspace",
              slug="my-workspace"
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.workspaces.update(
              {workspaceId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name: "My Workspace", slug: "my-workspace"}
            )
        - lang: go
          source: |
            package main

            import (
              "context"

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

            client := openlayer.NewClient()
            client.Workspaces.Update(
              context.TODO(),
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              openlayer.WorkspaceUpdateParams{
                Name: openlayer.F("My Workspace"),
                Slug: openlayer.F("my-workspace"),
              },
            )
        - lang: java
          source: >
            import com.openlayer.api.client.OpenlayerClient;

            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;

            import com.openlayer.api.models.WorkspaceUpdateParams;

            import com.openlayer.api.models.WorkspaceUpdateResponse;


            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();


            WorkspaceUpdateParams params =
            WorkspaceUpdateParams.builder().build();

            WorkspaceUpdateResponse response =
            client.workspaces().update(params);
        - lang: curl
          source: |
            curl --request PUT \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --header 'Authorization: Bearer <token>' \
              --data '{
                "name": "My Workspace",
                "slug": "my-workspace"
              }'
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.

````