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

# Update Extractor

> Update an extractor name or slug.

Update the name or slug of an existing extractor. This endpoint only modifies metadata — to update the extraction logic, use the Extractor Builder in the Doctly dashboard.

<Note>
  Some extractors installed from the catalog cannot be modified.
</Note>

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token authentication. Example: `Bearer YOUR_API_KEY`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

### Path Parameters

<ParamField path="extractor_id" type="string" required>
  The unique identifier (UUID) of the extractor to update
</ParamField>

### Body Parameters

<ParamField body="name" type="string">
  New display name for the extractor (max 255 characters)
</ParamField>

<ParamField body="slug" type="string">
  New URL-friendly identifier (3-100 characters, must be unique within your account)
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT https://api.doctly.ai/api/v1/e/987fcdeb-a654-3210-9876-543210987654 \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Invoice Parser v2",
      "slug": "invoice-parser-v2"
    }'
  ```

  ```python Python theme={null}
  import requests

  extractor_id = "987fcdeb-a654-3210-9876-543210987654"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  data = {
      "name": "Invoice Parser v2",
      "slug": "invoice-parser-v2"
  }

  response = requests.put(
      f"https://api.doctly.ai/api/v1/e/{extractor_id}",
      headers=headers,
      json=data
  )

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const extractorId = '987fcdeb-a654-3210-9876-543210987654';

  const response = await fetch(
    `https://api.doctly.ai/api/v1/e/${extractorId}`,
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        name: 'Invoice Parser v2',
        slug: 'invoice-parser-v2'
      })
    }
  );

  const extractor = await response.json();
  console.log(`Updated: ${extractor.name}`);
  ```
</CodeGroup>

## Response

Returns the updated extractor object.

<Expandable title="Extractor Object">
  <ResponseField name="id" type="string">
    Unique identifier (UUID) for the extractor
  </ResponseField>

  <ResponseField name="name" type="string">
    Updated display name
  </ResponseField>

  <ResponseField name="slug" type="string">
    Updated URL-friendly identifier
  </ResponseField>

  <ResponseField name="description" type="string">
    Description of the extractor
  </ResponseField>

  <ResponseField name="cost_type" type="string">
    Pricing model: `PER_PAGE` or `PER_DOCUMENT`
  </ResponseField>

  <ResponseField name="cost_credits" type="integer">
    Credits charged per page or per document
  </ResponseField>
</Expandable>

## Example Responses

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "987fcdeb-a654-3210-9876-543210987654",
    "name": "Invoice Parser v2",
    "slug": "invoice-parser-v2",
    "description": "Extract invoice details including vendor, line items, and totals",
    "cost_type": "PER_PAGE",
    "cost_credits": 5
  }
  ```

  ```json 403 Forbidden theme={null}
  {
    "detail": "This extractor cannot be edited."
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "detail": "Extractor not found or you do not have access to it."
  }
  ```

  ```json 409 Conflict — Duplicate Slug theme={null}
  {
    "detail": "An active extractor with slug 'invoice-parser-v2' already exists."
  }
  ```

  ```json 422 Unprocessable Entity theme={null}
  {
    "detail": [
      {
        "loc": ["body", "slug"],
        "msg": "ensure this value has at least 3 characters",
        "type": "value_error.any_str.min_length"
      }
    ]
  }
  ```
</ResponseExample>

## Slug Requirements

The `slug` must:

* Be 3-100 characters long
* Be unique within your account
* Be URL-friendly (lowercase letters, numbers, and hyphens recommended)

<Warning>
  Changing an extractor's slug will break any integrations using the old slug. Update your API calls to use the new slug.
</Warning>


## OpenAPI

````yaml PUT /e/{extractor_id}
openapi: 3.1.0
info:
  title: Doctly API
  description: >-
    The Doctly API enables you to programmatically convert PDF documents to
    Markdown and extract structured data using custom extractors.
  version: 1.0.0
  contact:
    email: support@doctly.ai
servers:
  - url: https://api.doctly.ai/api/v1
    description: Production server
security:
  - bearerAuth: []
paths:
  /e/{extractor_id}:
    put:
      tags:
        - Extractors
      summary: Update Extractor
      description: Update an existing extractor
      operationId: updateExtractor
      parameters:
        - name: extractor_id
          in: path
          required: true
          description: Extractor ID
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtractorUpdate'
      responses:
        '200':
          description: Extractor updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtractorPublic'
        '404':
          description: Extractor not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ExtractorUpdate:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        slug:
          type: string
          minLength: 3
          maxLength: 100
    ExtractorPublic:
      type: object
      required:
        - id
        - name
        - slug
        - cost_type
        - cost_credits
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        slug:
          type: string
        description:
          type: string
          nullable: true
        cost_type:
          type: string
          enum:
            - PER_PAGE
            - PER_DOCUMENT
        cost_credits:
          type: integer
    Error:
      type: object
      properties:
        detail:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                properties:
                  loc:
                    type: array
                    items:
                      type: string
                  msg:
                    type: string
                  type:
                    type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication using Bearer token

````