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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.affinda.com/feedback

```json
{
  "path": "/api-reference/workspaces/update-a-workspace",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Update a workspace

> Update a workspace.



## OpenAPI

````yaml https://api.affinda.com/static/v3/api_spec.yaml patch /v3/workspaces/{identifier}
openapi: 3.0.3
info:
  description: >-
    # Introduction

    Affinda uses the latest advancements in AI technology to rapidly process
    documents with better-than-human accuracy.

    This guide covers how to:

    * Extract structured data from a range of document types

    * Integrate our solutions into your platform

    * Manage users


    *Note: This API spec is for v3 of the API, the deprecated v2 documentation
    [can be found here](https://api.affinda.com/docs/v2)*


    > **Important: Use the correct API URL for your region.** Affinda is hosted
    across multiple instances. Make sure you are sending requests to the correct
    URL for your account:

    > | Instance | API Base URL |

    > |----------|-------------|

    > | **AUS / Global** | `https://api.affinda.com` |

    > | **US** | `https://api.us1.affinda.com` |

    > | **EU** | `https://api.eu1.affinda.com` |

    >

    > You can determine your instance from the URL you use to access the Affinda
    web app (e.g. `app.us1.affinda.com` means you are on the US instance). When
    using the "Try it" feature, select the matching region from the server
    dropdown.

    # Getting Started

    * Obtain an API key by [signing up for a
    free-trial](https://app.affinda.com/auth/register)

    * (Recommended) Download and install one of our client libraries: *
    [Python](https://github.com/affinda/affinda-python) : `pip install affinda`
    * [Javascript](https://github.com/affinda/affinda-typescript) : `npm install
    @affinda/affinda` * [.NET](https://github.com/affinda/affinda-dotnet):
    `dotnet add package Affinda.API` *
    [Java](https://github.com/affinda/affinda-java) - [maven
    repository](https://mvnrepository.com/artifact/com.affinda.api/affinda-api-client)

    * Without a client library, API requests via HTTP according to the API spec
    in this documentation
  version: v3
  title: Affinda API
  contact:
    email: contact@affinda.com
  license:
    name: MIT
    url: https://raw.githubusercontent.com/affinda/affinda-api-spec/master/LICENSE
  x-logo:
    url: https://api.affinda.com/static/documentation/affinda_logo.png
    backgroundColor: '#FFFFFF'
    altText: Affinda logo
servers:
  - url: https://{region}.affinda.com
    description: >-
      Select the correct server for your instance: api (AUS/Global), api.us1
      (US), or api.eu1 (EU).
    variables:
      region:
        default: api
        description: >-
          The instance region. Use 'api' for AUS/Global, 'api.us1' for US, or
          'api.eu1' for EU. You can find your region in the Affinda web app URL.
        enum:
          - api
          - api.eu1
          - api.us1
        x-ms-parameter-location: client
security:
  - ApiKeyAuth: []
tags:
  - name: Documents
    description: >
      Operations to upload documents for parsing.


      A document can be uploaded using `file` or `url`, one of these parameters
      must be provided.


      A document can be uploaded to a `workspace` or a `collection`, one of
      these parameters must also be provided.


      When uploaded to a workspace, the document's specific type will be
      predicted and auto classified into one of the collections before being
      parsed.


      When uploaded to a collection, the document will be parsed using that
      collection's extractor.
  - name: Organizations
    description: |
      Operations to manage organizations and organization memberships.

      Organizations are the top-level entity for managing users and workspaces.
  - name: Workspaces
    description: |
      Operations to manage workspaces.

      Workspaces group together related collections of documents.
  - name: Document Types
    description: >
      Operations to manage document types.


      Document types represent specific categories of documents with common
      extraction patterns, such as invoices or resumes.
  - name: Data Sources
    description: >
      Operations to manage custom mapping data sources. These are used to map
      from raw data extracted by

      Affinda AI models onto your own data model.
  - name: Validation Results
    description: >
      Operations to manage validation results.


      Validation results track the status and outcomes of document validation
      processes.
  - name: Usage
    description: >
      Operations to retrieve credits consumption.


      Returns daily credits usage for an organization, optionally narrowed to a
      single

      workspace or document type.
  - name: Tags
    description: >
      Operations to manage tags.


      Tags can be arbitrarily attached to documents to help organize and manage
      them.
  - name: Annotations
    description: >
      Operations to manually create, update, delete annotations.


      Together with the data point endpoints, these helps to annotate your
      documents with arbitrary data,

      or to edit annotations that were created by the Affinda parser.
  - name: Webhooks
    description: >
      Manage webhook integrations with your apps.


      Affinda have implemented webhooks to allow the data extracted by Affinda
      to be 'pushed' to you when an event occurs

      (e.g. document parsed or document validated), instead of you having to
      constantly poll our API to 'pull' the data to your system.
  - name: Search & Match
    description: >
      Operations to search through an index of documents and manage indexes via
      the Affinda Resume Parser API or a client library.


      Resumes and job descriptions must be explicitly added to an index, which
      then makes them searchable.
  - name: Deprecated End Points
    description: >
      Deprecated endpoints that are maintained for backward compatibility.


      These endpoints include Data Point, Collection, and Users functionality
      that has been superseded by newer APIs.
  - name: Add x-hidden to endpoints
    description: >
      Hidden endpoints not intended for public use.


      These endpoints include Splitting, Extractor, Organization, and Workspace
      Memberships & Usage functionality.
paths:
  /v3/workspaces/{identifier}:
    patch:
      tags:
        - Workspaces
      summary: Update a workspace
      description: Update a workspace.
      operationId: updateWorkspace
      parameters:
        - in: path
          required: true
          name: identifier
          description: Workspace's identifier
          schema:
            $ref: '#/components/schemas/identifier'
      requestBody:
        description: Workspace data to update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkspaceUpdate'
      responses:
        '200':
          description: Successfully updated workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workspace'
        '400':
          $ref: '#/components/responses/400Error'
        '401':
          $ref: '#/components/responses/401Error'
        default:
          $ref: '#/components/responses/DefaultError'
components:
  schemas:
    identifier:
      type: string
      description: Uniquely identify a workspace.
      example: mEFayXdO
    WorkspaceUpdate:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/name'
        visibility:
          $ref: '#/components/schemas/WorkspaceVisibility'
        rejectInvalidDocuments:
          $ref: '#/components/schemas/rejectInvalidDocuments'
        rejectDuplicates:
          $ref: '#/components/schemas/RejectDuplicates'
        documentTypes:
          type: array
          description: Document types to associate with this workspace
          items:
            $ref: '#/components/schemas/properties-identifier'
        whitelistIngestAddresses:
          $ref: '#/components/schemas/whitelistIngestAddresses'
        documentSplitter:
          $ref: '#/components/schemas/DocumentSplitter_properties-identifier'
          nullable: true
    Workspace:
      type: object
      required:
        - identifier
      properties:
        identifier:
          type: string
          description: Uniquely identify a workspace.
          example: mEFayXdO
        organization:
          $ref: '#/components/schemas/Organization'
        name:
          type: string
        visibility:
          $ref: '#/components/schemas/WorkspaceVisibility'
        collections:
          type: array
          items:
            type: object
            required:
              - identifier
              - name
              - extractor
            properties:
              identifier:
                $ref: '#/components/schemas/properties-identifier'
              name:
                $ref: '#/components/schemas/name'
              extractor:
                type: object
                required:
                  - identifier
                  - name
                  - namePlural
                  - validatable
                properties:
                  identifier:
                    $ref: '#/components/schemas/Extractor_properties-identifier'
                  name:
                    $ref: '#/components/schemas/name'
                  namePlural:
                    $ref: '#/components/schemas/namePlural'
                  baseExtractor:
                    $ref: '#/components/schemas/baseExtractor'
                  category:
                    $ref: '#/components/schemas/category'
                  validatable:
                    $ref: '#/components/schemas/validatable'
                  createdDt:
                    $ref: '#/components/schemas/createdDt'
              unvalidatedDocsCount:
                $ref: '#/components/schemas/unvalidatedDocsCount'
              confirmedDocsCount:
                $ref: '#/components/schemas/confirmedDocsCount'
        documentTypes:
          type: array
          description: Document types associated with this workspace
          items:
            $ref: '#/components/schemas/properties-identifier'
        rejectInvalidDocuments:
          type: boolean
          description: >-
            If true, the uploaded document will be rejected if it's of the wrong
            document type, or if its document type cannot be determined. No
            credits will be consumed.
        rejectDuplicates:
          $ref: '#/components/schemas/RejectDuplicates'
        members:
          type: array
          items:
            $ref: '#/components/schemas/User'
        unvalidatedDocsCount:
          type: integer
          minimum: 0
          description: Number of unvalidated documents in the workspace.
        confirmedDocsCount:
          type: integer
          minimum: 0
          description: Number of validated documents in the workspace.
        ingestEmail:
          type: string
          description: >-
            When you send email to this address, any document attached in the
            body will be uploaded to this workspace.
        whitelistIngestAddresses:
          type: array
          nullable: true
          description: >-
            If specified, only emails from these addresses will be ingested for
            parsing. Wild cards are allowed, e.g. "*@eyefind.info".
          items:
            type: string
            example: '*@eyefind.info'
        documentSplitter:
          $ref: '#/components/schemas/WorkspaceDocumentSplitter'
          nullable: true
    name:
      type: string
    WorkspaceVisibility:
      type: string
      enum:
        - organization
        - private
      description: >-
        Visibility "organization" means everyone in the organization can access
        the workspace. Visibility "private" means only people explicitly added
        can access the workspace.
      example: organization
    rejectInvalidDocuments:
      type: boolean
      description: >-
        If true, the uploaded document will be rejected if it's of the wrong
        document type, or if its document type cannot be determined. No credits
        will be consumed.
    RejectDuplicates:
      type: boolean
      description: >-
        If "true", parsing will fail when the uploaded document is duplicate of
        an existing document, no credits will be consumed. If "false", will
        parse the document normally whether its a duplicate or not. If not
        provided, will fallback to the workspace settings.
      example: true
      nullable: true
    properties-identifier:
      type: string
      description: Uniquely identify a collection.
      example: mEFayXdO
    whitelistIngestAddresses:
      type: array
      nullable: true
      description: >-
        If specified, only emails from these addresses will be ingested for
        parsing. Wild cards are allowed, e.g. "*@eyefind.info".
      items:
        type: string
        example: '*@eyefind.info'
    DocumentSplitter_properties-identifier:
      type: string
      description: Uniquely identify a document splitter.
      example: NqIvMvZl
    Organization:
      type: object
      properties:
        identifier:
          type: string
          description: Uniquely identify an organization.
          example: mEFayXdO
        name:
          type: string
          example: Grove Street King
        userRole:
          type: string
          allOf:
            - $ref: '#/components/schemas/OrganizationRole'
          nullable: true
          description: The role of the logged in user within the organization.
        avatar:
          type: string
          nullable: true
          description: URL of the organization's avatar.
          example: >-
            https://affinda-api.s3.amazonaws.com/media/org-avatar.png?AWSAccessKeyId=KEY&Signature=SIG
        resthookSignatureKey:
          type: string
          nullable: true
          description: Used to sign webhook payloads so you can verify their integrity.
          example: 465c6598bd34c0558f0ce256c43209d49fa85b0ff3e4c18b24e408b7563143ad
        isTrial:
          type: boolean
        validationToolConfig:
          type: object
          nullable: true
          description: Configuration of the embeddable validation tool.
          properties:
            theme:
              $ref: '#/components/schemas/ThemeConfig'
            hideActions:
              type: boolean
              description: Hide the confirm document button and other actions.
            hideCollection:
              type: boolean
              description: Hide the collection selector.
            hideEditPages:
              type: boolean
              description: Hide the edit pages button.
            hideExport:
              type: boolean
              description: Hide the export menu.
            hideFilename:
              type: boolean
              description: Hide the filename input.
            hideShowRawValues:
              type: boolean
              description: Hide the toggle for showing raw annotation values.
            hideReject:
              type: boolean
              description: Hide the reject document button.
            hideReparse:
              type: boolean
              description: Hide the reparse button.
            hideRunOcr:
              type: boolean
              description: Hide the run OCR button.
            hideTags:
              type: boolean
              description: Hide the tags editor.
            hideWarnings:
              type: boolean
              description: Hide the warnings panel.
            restrictDocumentSplitting:
              type: boolean
              description: Disable the page editor after a document has been split once.
            disableCurrencyFormatting:
              type: boolean
              description: Disable currency formatting of decimals values.
            disableEditDocumentMetadata:
              type: boolean
              description: >-
                Disable editing document metadata. Makes the collection
                selector, filename input and tags editor read only.
            disableManualAnnotationEditing:
              type: boolean
              description: >-
                Disable manual editing of annotation values via the validation
                popover.
            hideDocumentStatus:
              type: boolean
              description: Hide the document status indicator in the toolbar.
        showCustomFieldCreation:
          type: boolean
          description: Whether to show the custom field creation in the UI.
    Extractor_properties-identifier:
      type: string
      description: Uniquely identify an extractor.
      example: resume
    namePlural:
      type: string
    baseExtractor:
      type: object
      nullable: true
      required:
        - identifier
        - name
        - namePlural
        - validatable
      properties:
        identifier:
          $ref: '#/components/schemas/Extractor_properties-identifier'
        name:
          $ref: '#/components/schemas/name'
        namePlural:
          $ref: '#/components/schemas/namePlural'
        validatable:
          $ref: '#/components/schemas/validatable'
        isCustom:
          $ref: '#/components/schemas/isCustom'
        createdDt:
          $ref: '#/components/schemas/createdDt'
    category:
      type: string
      nullable: true
      example: Recruitment
    validatable:
      type: boolean
    createdDt:
      type: string
      format: date-time
    unvalidatedDocsCount:
      type: integer
      nullable: true
      minimum: 0
      description: Number of unvalidated documents in the collection.
    confirmedDocsCount:
      type: integer
      nullable: true
      minimum: 0
      description: Number of validated documents in the collection.
    User:
      type: object
      properties:
        id:
          type: integer
          description: Uniquely identify a user.
          example: 1
          minimum: 1
        name:
          type: string
          example: Carl Johnson
        username:
          type: string
          example: carljohnson
        email:
          type: string
          example: carljohnson@grove.street
        avatar:
          type: string
          nullable: true
          description: URL of the user's avatar.
          example: >-
            https://affinda-api.s3.amazonaws.com/media/user-avatar.png?AWSAccessKeyId=KEY&Signature=SIG
    WorkspaceDocumentSplitter:
      type: object
      required:
        - identifier
        - name
      properties:
        identifier:
          $ref: '#/components/schemas/DocumentSplitter_properties-identifier'
        name:
          $ref: '#/components/schemas/name'
    RequestError:
      type: object
      additionalProperties: false
      required:
        - type
        - errors
      properties:
        type:
          type: string
          example: validation_error
        errors:
          type: array
          items:
            type: object
            required:
              - attr
              - code
              - detail
            properties:
              attr:
                type: string
                nullable: true
                example: non_field_errors
              code:
                type: string
                example: unique
              detail:
                type: string
                example: This index name has already been used
    OrganizationRole:
      type: string
      enum:
        - admin
        - member
      example: admin
    ThemeConfig:
      type: object
      properties:
        palette:
          type: object
          properties:
            mode:
              type: string
              enum:
                - light
                - dark
            background:
              oneOf:
                - type: string
                - type: object
                  properties:
                    default:
                      type: string
                    paper:
                      type: string
            text:
              type: object
              properties:
                primary:
                  type: string
                secondary:
                  type: string
                disabled:
                  type: string
            divider:
              type: string
            primary:
              $ref: '#/components/schemas/PaletteColorOptions'
            secondary:
              $ref: '#/components/schemas/PaletteColorOptions'
            success:
              $ref: '#/components/schemas/PaletteColorOptions'
            annotation:
              $ref: '#/components/schemas/PaletteColorOptions'
            error:
              $ref: '#/components/schemas/PaletteColorOptions'
            info:
              $ref: '#/components/schemas/PaletteColorOptions'
            warning:
              $ref: '#/components/schemas/PaletteColorOptions'
        typography:
          type: object
          properties:
            fontFamily:
              type: string
            fontSize:
              oneOf:
                - type: string
                - type: number
            fontWeightRegular:
              type: string
            fontWeightMedium:
              type: string
            fontWeightBold:
              type: string
        borderRadius:
          type: number
        fontUrl:
          type: string
    isCustom:
      type: boolean
    PaletteColorOptions:
      type: object
      required:
        - main
      properties:
        main:
          type: string
        light:
          type: string
        dark:
          type: string
        contrastText:
          type: string
  responses:
    400Error:
      description: >-
        Bad request. If it is a validation error will contain a list of each
        invalid field
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RequestError'
      x-ms-error-response: true
    401Error:
      description: Authorisation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RequestError'
      x-ms-error-response: true
    DefaultError:
      description: UnexpectedError
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RequestError'
      x-ms-error-response: true
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Basic authentication using an API key, e.g. `{Authorization: Bearer
        aff_0bb4fbdf97b7e4111ff6c0015471094155f91}`.

        You can find your API key within the Settings page of the [Affinda web
        app](https://app.affinda.com/). You can obtain an API key by [signing up
        for a free trial](https://app.affinda.com/auth/register).

````