> ## Documentation Index
> Fetch the complete documentation index at: https://openlayer.com/docs/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: 6298a9ad-13f2-4bf0-81b1-c72ef9645a8c
                slug: c2f8aebb-42e5-4cf9-b64f-ddee9d6287eb
                inviteCode: 2881ae17-9c00-4a8e-a249-56d8949a0c7e
      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()

            workspace = client.workspaces.update(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                name="My Workspace",
                slug="my-workspace",
            )
            print(workspace.slug)
        - lang: typescript
          source: >
            import Openlayer from 'openlayer';


            const client = new Openlayer();


            const workspace = await
            client.workspaces.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              name: 'My Workspace',
              slug: 'my-workspace',
            });


            console.log(workspace.slug);
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\nworkspace, err := client.Workspaces.Update(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.WorkspaceUpdateParams{\n\t\tName: openlayer.F(\"Openlayer Staging\"),\n\t\tSlug: openlayer.F(\"openlayer-staging\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", workspace.Name)\n"
        - lang: java
          source: >
            import com.openlayer.api.client.OpenlayerClient;

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

            import com.openlayer.api.models.workspaces.WorkspaceUpdateParams;

            import com.openlayer.api.models.workspaces.WorkspaceUpdateResponse;


            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();


            WorkspaceUpdateParams params = WorkspaceUpdateParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .name("Openlayer")
                .slug("openlayer")
                .build();
            WorkspaceUpdateResponse workspace =
            client.workspaces().update(params);
        - lang: ruby
          source: >
            require "openlayer"


            openlayer = Openlayer::Client.new(api_key: ENV["OPENLAYER_API_KEY"])


            workspace =
            openlayer.workspaces.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            name: "Openlayer")


            puts(workspace)
        - 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.

````

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