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

# Delete Custom Field by Name

> Delete a custom field by name to remove it from all contacts using the AutoSend API.

<RequestExample>
  ```bash cURL theme={null}
  curl --request DELETE \
    --url https://api.autosend.com/v1/custom-fields/fieldName/planTier \
    --header 'Authorization: Bearer <token>'
  ```

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

  url = "https://api.autosend.com/v1/custom-fields/fieldName/planTier"

  headers = {
      "Authorization": "Bearer <token>"
  }

  response = requests.delete(url, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.autosend.com/v1/custom-fields/fieldName/planTier",
    {
      method: "DELETE",
      headers: {
        Authorization: "Bearer <token>",
      },
    }
  );

  const data = await response.json();
  console.log(data);
  ```

  ```php PHP theme={null}
  <?php
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.autosend.com/v1/custom-fields/fieldName/planTier",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => [
      "Authorization: Bearer <token>",
    ],
  ]);

  $response = curl_exec($curl);
  curl_close($curl);

  echo $response;
  ```

  ```go Go theme={null}
  package main

  import (
    "fmt"
    "net/http"
    "io/ioutil"
  )

  func main() {
    req, _ := http.NewRequest("DELETE", "https://api.autosend.com/v1/custom-fields/fieldName/planTier", nil)
    req.Header.Set("Authorization", "Bearer <token>")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  public class Main {
    public static void main(String[] args) throws Exception {
      HttpClient client = HttpClient.newHttpClient();

      HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://api.autosend.com/v1/custom-fields/fieldName/planTier"))
        .header("Authorization", "Bearer <token>")
        .DELETE()
        .build();

      HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
      System.out.println(response.body());
    }
  }
  ```

  ```ruby Ruby theme={null}
  require "net/http"
  require "uri"

  uri = URI.parse("https://api.autosend.com/v1/custom-fields/fieldName/planTier")
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Delete.new(uri)
  request["Authorization"] = "Bearer <token>"

  response = http.request(request)
  puts response.body
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "message": "Custom field deleted successfully"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "success": false,
    "message": "Custom field not found",
    "code": "CUSTOM_FIELD_NOT_FOUND"
  }
  ```
</ResponseExample>

### Authorizations

<ParamField path="Authorizations" type="string | header" required>
  Bearer authentication header of the form Bearer `<token>`, where `<token>` is your auth token.
</ParamField>

#### Path Parameters

<ParamField path="customFieldName" type="string" required>
  The `fieldName` of the custom field to delete.
</ParamField>


## OpenAPI

````yaml DELETE /custom-fields/fieldName/{customFieldName}
openapi: 3.1.0
info:
  title: Custom Fields API
  description: >-
    API for managing custom contact fields in an Autosend project. Custom fields
    let you define dynamic attributes that are attached to every contact in your
    project. Reserved built-in field names cannot be used when creating custom
    fields.
  version: 1.0.0
servers:
  - url: https://api.autosend.com/v1
security:
  - BearerAuth: []
paths:
  /custom-fields/fieldName/{customFieldName}:
    delete:
      tags:
        - Custom Fields
      summary: Delete custom field by name
      description: >-
        Permanently deletes a custom field by its `fieldName`. This action
        cannot be undone. Any contact data stored against this field will no
        longer be accessible via the field definition.
      operationId: deleteCustomFieldByName
      parameters:
        - name: customFieldName
          in: path
          required: true
          description: The `fieldName` of the custom field to delete.
          schema:
            type: string
            example: planTier
      responses:
        '200':
          description: Custom field deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Custom field deleted successfully
                  data:
                    $ref: '#/components/schemas/CustomField'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    CustomField:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the custom field.
          example: 60d5ec49f1b2c72d9c8b9999
        fieldName:
          type: string
          description: The programmatic name of the field. Used as the merge tag key.
          example: planTier
        fieldType:
          type: string
          enum:
            - string
            - number
            - date
          description: The data type of the field.
          example: string
        description:
          type: string
          nullable: true
          description: A human-readable description of the field's purpose.
          example: The user's subscription tier
        defaultValue:
          nullable: true
          description: >-
            The value to use when a contact does not have an explicit value for
            this field.
          example: free
        isReserved:
          type: boolean
          description: >-
            Whether this is a built-in reserved field. Reserved fields cannot be
            deleted.
          example: false
        disabled:
          type: boolean
          nullable: true
          description: >-
            Whether this field is disabled for editing. Only applicable to
            certain reserved fields.
          example: false
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the field was created.
          example: '2026-01-10T08:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the field was last updated.
          example: '2026-01-10T08:00:00.000Z'
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: An error occurred
        code:
          type: string
          example: ERROR_CODE
  responses:
    Unauthorized:
      description: Missing or invalid Bearer token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Unauthorized
            code: UNAUTHORIZED
    NotFound:
      description: The requested custom field was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Custom field not found
            code: CUSTOM_FIELD_NOT_FOUND
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````