AWeber Custom Fields API

The Custom Fields API from AWeber — 5 operations for creating, reading, renaming and deleting the custom subscriber fields defined on a list.

Operations 5

GET /accounts/{accountId}/lists/{listId}/custom_fields Get custom fields #
POST /accounts/{accountId}/lists/{listId}/custom_fields Add custom field #
GET /accounts/{accountId}/lists/{listId}/custom_fields/{customFieldId} Get custom field #
DELETE /accounts/{accountId}/lists/{listId}/custom_fields/{customFieldId} Delete custom field #
PATCH /accounts/{accountId}/lists/{listId}/custom_fields/{customFieldId} Update custom field #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/aweber-custom-fields-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

aweber-custom-fields-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: AWeber Custom Fields API
  version: '1.0'
  description: 'We are constantly working to improve this documentation. If you have

    feedback and questions, please contact the AWeber API team at

    api@aweber.com.


    The AWeber API is a REST API that uses the OAuth 2.0 authentication model. We also offer webhooks.


    Please see the below resources for further information:

    - <a href="https://labs.aweber.com/docs/tos" target="_blank">Terms of Service</a>

    - <a href="https://help.aweber.com/hc/en-us/articles/204031776" target="_blank">Showcasing an Integration</a>

    - <a href="https://help.aweber.com/hc/en-us/sections/360000617213-API" target="_blank">Knowledge Base</a>

    - <a href="https://status.aweber.com" target="_blank">API Status Page</a>

    '
  contact:
    name: AWeber API Team
    email: api@aweber.com
    url: https://api.aweber.com/
servers:
- url: https://api.aweber.com/1.0
  description: v1 API endpoints
security:
- OAuth 2.0: []
tags:
- name: Custom Fields
  description: "### What is it?\n\nRepresents the custom fields associated with a list.\n\nUse this set of resources to retrieve, create, modify, and delete the custom fields that\nare defined for subscribers on the list.  The single collection response is sorted by the\ngenerated custom field `id` and paginated using `next_collection_link` and\n`prev_collection_link` properties.  See [How Collections are Represented](#collection-representation)\nfor details on collection traversal.\n\n### Warning about modifying Custom Fields\n\nModifying or deleting a custom field has a number of side-effects that need to be understood\n*BEFORE* you change them.  See\n<a href=\"https://help.aweber.com/entries/21749682-why-could-changing-my-custom-field-names-cause-problems\"\n target=\"_blank\">Why could changing my custom field names cause problems</a> for more details.\n\n### Related endpoints\n\n* [Custom Fields](#tag/Custom-Fields)\n* [Find subscribers within an account by custom field](#tag/Subscribers/paths/~1accounts~1{accountId}?ws.op=findSubscribers/get)\n* [Find subscribers on a list by custom field](#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers?ws.op=find/get)\n\n### Related code samples\n\n* [Manage Custom Fields](#tag/Manage-Custom-Fields)\n"
paths:
  /accounts/{accountId}/lists/{listId}/custom_fields:
    get:
      summary: Get custom fields
      description: "This endpoint is used to get a paginated collection of custom fields under the specified account and list\n\nCheck out related examples:\n\n  * Manage Custom Fields (\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/python/manage-custom-fields\" target=\"_blank\">Python</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/php/manage-custom-fields\" target=\"_blank\">PHP</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/postman/Manage%20Custom%20Fields.postman_collection.json\" target=\"_blank\">Postman</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/csharp/AWeber.Examples.ManageCustomFields\" target=\"_blank\">C#.NET</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/ruby/manage_custom_fields.rb\" target=\"_blank\">Ruby</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/node/manage-custom-fields.js\" target=\"_blank\">Node.js</a> )"
      tags:
      - Custom Fields
      parameters:
      - $ref: '#/components/parameters/accountId'
      - $ref: '#/components/parameters/listId'
      - $ref: '#/components/parameters/wsStart'
      - $ref: '#/components/parameters/wsSize'
      security:
      - OAuth 2.0:
        - list.read
      x-code-samples:
      - lang: Shell
        source: "curl -G \\\n  https://api.aweber.com/1.0/accounts/{accountId}/lists/{listId}/custom_fields \\\n  -H 'Authorization: Bearer {YOUR_ACCESS_TOKEN}'\n"
      - lang: Python
        source: "headers = {'Accept': 'application/json',\n           'User-Agent': 'AWeber-Python-code-sample/1.0',\n           'Authorization': f'Bearer {access_token}'}\nurl = (f'https://api.aweber.com/1.0/accounts/{account_id}'\n       f'/lists/{list_id}/custom_fields')\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n"
      - lang: PHP
        source: "$headers = [\n    'User-Agent' => 'AWeber-PHP-code-sample/1.0',\n    'Accept' => 'application/json',\n    'Authorization' => 'Bearer $token',\n];\n$url = \"https://api.aweber.com/1.0/accounts/{$accountId}/lists/{$listId}/custom_fields\";\n$response = $client->get($url, ['headers' => $headers]);\n$body = json_decode($response->getBody(), true);\nprint_r($body);\n"
      - lang: C#
        source: 'const string url = "https://api.aweber.com/1.0/accounts/{accountId}/lists/{listId}/custom_fields";

          var request = new HttpRequestMessage(HttpMethod.Get, url);

          request.Headers.Add("Accept","application/json");

          request.Headers.Add("User-Agent","AWeber-CSharp-code-sample/1.0");

          request.Headers.Add("Authorization", $"Bearer {Token}");

          var response = await Client.SendAsync(request);

          Console.Write(response.Content.ReadAsStringAsync());

          '
      - lang: JavaScript
        label: Node.js
        source: "const headers = {\n  \"Accept\": \"application/json\",\n  \"User-Agent\": \"AWeber-Node-code-sample/1.0\",\n  \"Authorization\": `Bearer ${accessToken}`\n};\nconst url = `https://api.aweber.com/1.0/accounts/${accountId}/lists/${listId}/custom_fields`;\nfetch(url, { headers: headers })\n  .then(response => response.json())\n  .then(data => {\n    console.log(data)\n})\n"
      - lang: Ruby
        source: "headers = {\n  'Accept': 'application/json',\n  'User-Agent': 'AWeber-Ruby-code-sample/1.0',\n  'Authorization': \"Bearer #{access_token}\"\n}\nresponse = Faraday.get(\n  \"https://api.aweber.com/1.0/accounts/#{account_id}/\" \\\n  \"lists/#{list_id}/custom_fields\",\n) do |req|\n  req.headers = headers\nend\nputs response.body\n"
      responses:
        '200':
          description: The request completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomFields'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFound'
        '410':
          $ref: '#/components/responses/BlockedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      operationId: getCustomFields
    post:
      summary: Add custom field
      description: "This endpoint is used to add a new custom field to the specified account and list.\n\nCheck out related examples:\n\n  * Manage Custom Fields (\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/python/manage-custom-fields\" target=\"_blank\">Python</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/php/manage-custom-fields\" target=\"_blank\">PHP</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/postman/Manage%20Custom%20Fields.postman_collection.json\" target=\"_blank\">Postman</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/csharp/AWeber.Examples.ManageCustomFields\" target=\"_blank\">C#.NET</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/ruby/manage_custom_fields.rb\" target=\"_blank\">Ruby</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/node/manage-custom-fields.js\" target=\"_blank\">Node.js</a> )"
      tags:
      - Custom Fields
      parameters:
      - $ref: '#/components/parameters/accountId'
      - $ref: '#/components/parameters/listId'
      security:
      - OAuth 2.0:
        - list.write
      x-code-samples:
      - lang: Shell
        source: "curl -X POST \\\n  https://api.aweber.com/1.0/accounts/{accountId}/lists/{listId}/custom_fields \\\n  -d ws.op=create \\\n  -d \"name=Favorite Color\" \\\n  -H 'Authorization: Bearer {YOUR_ACCESS_TOKEN}'\n"
      - lang: Python
        source: "body = {\n    'name': 'Favorite Color',\n    'ws.op': 'create',\n}\nheaders = {'Content-Type': 'application/x-www-form-urlencoded',\n           'Accept': 'application/json',\n           'User-Agent': 'AWeber-Python-code-sample/1.0',\n           'Authorization': f'Bearer {access_token}'}\nurl = (f'https://api.aweber.com/1.0/accounts/{account_id}'\n       f'/lists/{list_id}/custom_fields')\nresponse = requests.post(url, headers=headers, data=body)\nprint(response.status_code)\n"
      - lang: PHP
        source: "$body = [\n    'name' => 'Favorite Color',\n    'ws.op' => 'create',\n];\n$headers = [\n    'Content-Type' => 'application/x-www-form-urlencoded',\n    'Accept' => 'application/json',\n    'Authorization' => 'Bearer $token',\n    'User-Agent' => 'AWeber-PHP-code-sample/1.0'\n];\n$url = \"https://api.aweber.com/1.0/accounts/{$accountId}/lists/{$listId}/custom_fields\";\n$response = $client->post($url, ['form_params' => $body, 'headers' => $headers]);\necho $response->getStatusCode();\n"
      - lang: C#
        source: "const string url = \"https://api.aweber.com/1.0/accounts/{accountId}/lists/{listId}/custom_fields\";\nvar payload = new Dictionary<string, string>\n{\n  {\"ws.op\", \"create\"},\n  {\"name\", \"Favorite Color\"}\n};\nvar request = new HttpRequestMessage(HttpMethod.Post, url);\nrequest.Content = new FormUrlEncodedContent(payload);\nrequest.Headers.Add(\"Accept\",\"application/json\");\nrequest.Headers.Add(\"User-Agent\",\"AWeber-CSharp-code-sample/1.0\");\nrequest.Headers.Add(\"Authorization\", $\"Bearer {Token}\");\nvar response = await Client.SendAsync(request);\nConsole.Write(response.Content.ReadAsStringAsync());\n"
      - lang: JavaScript
        label: Node.js
        source: "const headers = {\n  \"Accept\": \"application/json\",\n  \"Content-Type\": \"application/x-www-form-urlencoded\",\n  \"User-Agent\": \"AWeber-Node-code-sample/1.0\",\n  \"Authorization\": `Bearer ${accessToken}`\n};\nquerystring = require(\"querystring\")\nconst body = querystring.stringify({\n  \"name\": \"Favorite Color\",\n  \"ws.op\": \"create\"\n});\nconst url = `https://api.aweber.com/1.0/accounts/${accountId}/lists/${listId}/custom_fields`;\nfetch(url, { headers: headers, method: \"POST\", body: body })\n  .then(response => response.status)\n  .then(data => {\n    console.log(data)\n  })\n"
      - lang: Ruby
        source: "headers = {\n  'Accept': 'application/json',\n  'Content-Type': 'application/x-www-form-urlencoded',\n  'User-Agent': 'AWeber-Ruby-code-sample/1.0',\n  'Authorization': \"Bearer #{access_token}\"\n}\nbody = {\n  'name': 'Favorite Color',\n  'ws.op': 'create',\n}\nresponse = Faraday.post(\n  \"https://api.aweber.com/1.0/accounts/#{account_id}/\" \\\n  \"lists/#{list_id}/custom_fields\",\n  URI.encode_www_form(body)\n) do |req|\n  req.headers = headers\nend\nputs response.status\n"
      responses:
        '201':
          description: The custom field was created successfully
          headers:
            Location:
              description: URI of the new custom field
              example: https://api.aweber.com/1.0/accounts/123/lists/456/custom_fields/7
              schema:
                type: string
                format: uri
        '400':
          description: The server cannot or will not process the request due to a client error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    description: 'An error object.

                      The following error may be received:


                      | Error Type      | Explanation |

                      |-----------------|-------------|

                      | BadRequestError | The `ws.op` field is invalid or the OAuth query string could not be parsed.  This can also be caused by using an unsupported content type. |

                      | WebServiceError | The custom field could not be added since a field with the specified name already exists |

                      '
                    properties:
                      documentation_url:
                        description: A link to the documentation that describes the error
                        type: string
                        format: url
                        example: https://api.aweber.com#badrequest
                      message:
                        description: A human friendly description of the error
                        type: string
                        example: 'name: Must be unique'
                      status:
                        description: The HTTP status code
                        type: integer
                        enum:
                        - 400
                      type:
                        description: The API error type
                        type: string
                        enum:
                        - BadRequestError
                        - WebServiceError
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          description: The maximum number of custom fields has been exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    description: 'An error object.

                      The following error may be received:


                      | Error Type      | Explanation |

                      |-----------------|-------------|

                      | WebServiceError | The custom field could not be added since it already has 25 custom field definitions |

                      '
                    properties:
                      documentation_url:
                        description: A link to the documentation that describes the error
                        type: string
                        format: url
                        example: https://api.aweber.com#methodnotallowed
                      message:
                        description: A human friendly description of the error
                        type: string
                        example: You may only have 25 CustomFields
                      status:
                        description: The HTTP status code
                        type: integer
                        enum:
                        - 405
                      type:
                        description: The API error type
                        type: string
                        enum:
                        - WebServiceError
        '410':
          $ref: '#/components/responses/BlockedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              - ws.op
              properties:
                name:
                  description: The name of the custom field
                  type: string
                  example: Favorite color
                ws.op:
                  description: The method name - expecting "create"
                  type: string
                  enum:
                  - create
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - name
              - ws.op
              properties:
                name:
                  description: The name of the custom field
                  type: string
                  example: Favorite color
                ws.op:
                  description: The method name - expecting "create"
                  type: string
                  enum:
                  - create
            example: name=foo&ws.op=create
        description: Request Body
        required: true
      operationId: addCustomField
  /accounts/{accountId}/lists/{listId}/custom_fields/{customFieldId}:
    get:
      summary: Get custom field
      description: "This endpoint is used to retrieve the information for the specified custom field.\n\nCheck out related examples:\n\n  * Manage Custom Fields (\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/python/manage-custom-fields\" target=\"_blank\">Python</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/php/manage-custom-fields\" target=\"_blank\">PHP</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/postman/Manage%20Custom%20Fields.postman_collection.json\" target=\"_blank\">Postman</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/csharp/AWeber.Examples.ManageCustomFields\" target=\"_blank\">C#.NET</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/ruby/manage_custom_fields.rb\" target=\"_blank\">Ruby</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/node/manage-custom-fields.js\" target=\"_blank\">Node.js</a> )"
      tags:
      - Custom Fields
      parameters:
      - $ref: '#/components/parameters/accountId'
      - $ref: '#/components/parameters/listId'
      - $ref: '#/components/parameters/customFieldId'
      security:
      - OAuth 2.0:
        - list.read
      x-code-samples:
      - lang: Shell
        source: "curl -G \\\n  https://api.aweber.com/1.0/accounts/{accountId}/lists/{listId}/custom_fields/{customFieldId} \\\n  -H 'Authorization: Bearer {YOUR_ACCESS_TOKEN}'\n"
      - lang: Python
        source: "headers = {'Accept': 'application/json',\n           'User-Agent': 'AWeber-Python-code-sample/1.0',\n           'Authorization': f'Bearer {access_token}'}\nurl = (f'https://api.aweber.com/1.0/accounts/{account_id}'\n       f'/lists/{list_id}/custom_fields/{custom_field_id}')\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n"
      - lang: PHP
        source: "$headers = [\n    'User-Agent' => 'AWeber-PHP-code-sample/1.0',\n    'Accept' => 'application/json',\n    'Authorization' => 'Bearer $token',\n];\n$url = \"https://api.aweber.com/1.0/accounts/{$accountId}/lists/{$listId}/custom_fields/{$customFieldId}\";\n$response = $client->get($url, ['headers' => $headers]);\n$body = json_decode($response->getBody(), true);\nprint_r($body);\n"
      - lang: C#
        source: 'const string url = "https://api.aweber.com/1.0/accounts/{accountId}/lists/{listId}/custom_fields/{customFieldId}";

          var request = new HttpRequestMessage(HttpMethod.Get, url);

          request.Headers.Add("Accept","application/json");

          request.Headers.Add("User-Agent","AWeber-CSharp-code-sample/1.0");

          request.Headers.Add("Authorization", $"Bearer {Token}");

          var response = await Client.SendAsync(request);

          Console.Write(response.Content.ReadAsStringAsync());

          '
      - lang: JavaScript
        label: Node.js
        source: "const headers = {\n  \"Accept\": \"application/json\",\n  \"User-Agent\": \"AWeber-Node-code-sample/1.0\",\n  \"Authorization\": `Bearer ${accessToken}`\n};\nconst url = `https://api.aweber.com/1.0/accounts/${accountId}/lists/${listId}/custom_fields/${customFieldId}`;\nfetch(url, { headers: headers })\n  .then(response => response.json())\n  .then(data => {\n    console.log(data)\n})\n"
      - lang: Ruby
        source: "headers = {\n  'Accept': 'application/json',\n  'User-Agent': 'AWeber-Ruby-code-sample/1.0',\n  'Authorization': \"Bearer #{access_token}\"\n}\nresponse = Faraday.get(\n  \"https://api.aweber.com/1.0/accounts/#{account_id}/\" \\\n  \"lists/#{list_id}/custom_fields/#{custom_field_id}\",\n) do |req|\n  req.headers = headers\nend\nputs response.body\n"
      responses:
        '200':
          description: The request completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomField'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFound'
        '410':
          $ref: '#/components/responses/BlockedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      operationId: getCustomField
    delete:
      summary: Delete custom field
      description: "This endpoint is used to delete a custom field entry See <a href=\"https://help.aweber.com/entries/21749682-why-could-changing-my-custom-field-names-cause-problems\"\n target=\"_blank\">Why could changing my custom field names cause problems</a>\nbefore removing a Custom Field.\n\nCheck out related examples:\n\n  * Manage Custom Fields (\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/python/manage-custom-fields\" target=\"_blank\">Python</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/php/manage-custom-fields\" target=\"_blank\">PHP</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/postman/Manage%20Custom%20Fields.postman_collection.json\" target=\"_blank\">Postman</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/csharp/AWeber.Examples.ManageCustomFields\" target=\"_blank\">C#.NET</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/ruby/manage_custom_fields.rb\" target=\"_blank\">Ruby</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/node/manage-custom-fields.js\" target=\"_blank\">Node.js</a> )"
      tags:
      - Custom Fields
      parameters:
      - $ref: '#/components/parameters/accountId'
      - $ref: '#/components/parameters/listId'
      - $ref: '#/components/parameters/customFieldId'
      security:
      - OAuth 2.0:
        - list.write
      x-code-samples:
      - lang: Shell
        source: "curl -X DELETE \\\n  https://api.aweber.com/1.0/accounts/{accountId}/lists/{listId}/custom_fields/{customFieldId} \\\n  -H 'Authorization: Bearer {YOUR_ACCESS_TOKEN}'\n"
      - lang: Python
        source: "headers = {'Accept': 'application/json',\n           'User-Agent': 'AWeber-Python-code-sample/1.0',\n           'Authorization': f'Bearer {access_token}'}\nurl = (f'https://api.aweber.com/1.0/accounts/{account_id}'\n       f'/lists/{list_id}/custom_fields/{custom_field_id}')\nresponse = requests.delete(url, headers=headers)\nprint(response.status_code)\n"
      - lang: PHP
        source: "$headers = [\n    'Accept' => 'application/json',\n    'Authorization' => 'Bearer $token',\n    'User-Agent' => 'AWeber-PHP-code-sample/1.0'\n];\n$url = \"https://api.aweber.com/1.0/accounts/{$accountId}/lists/{$listId}/custom_fields/{$customFieldId}\";\n$response = $client->delete($url, ['headers' => $headers]);\necho $response->getStatusCode();\n"
      - lang: C#
        source: 'const string url = "https://api.aweber.com/1.0/accounts/{accountId}/lists/{listId}/custom_fields/{customFieldId}";

          var request = new HttpRequestMessage(HttpMethod.Delete, url);

          request.Headers.Add("Accept","application/json");

          request.Headers.Add("User-Agent","AWeber-CSharp-code-sample/1.0");

          request.Headers.Add("Authorization", $"Bearer {Token}");

          var response = await Client.SendAsync(request);

          Console.Write(response.StatusCode);

          '
      - lang: JavaScript
        label: Node.js
        source: "const headers = {\n  \"Accept\": \"application/json\",\n  \"User-Agent\": \"AWeber-Node-code-sample/1.0\",\n  \"Authorization\": `Bearer ${accessToken}`\n};\nconst url = `https://api.aweber.com/1.0/accounts/${accountId}/lists/${listId}/custom_fields/${customFieldId}`;\nfetch(url, { headers: headers, method: \"DELETE\" })\n  .then(response => response.status)\n  .then(data => {\n    console.log(data)\n  })\n"
      - lang: Ruby
        source: "headers = {\n  'Accept': 'application/json',\n  'Content-Type': 'application/json',\n  'User-Agent': 'AWeber-Ruby-code-sample/1.0',\n  'Authorization': \"Bearer #{access_token}\"\n}\nresponse = Faraday.delete(\n  \"https://api.aweber.com/1.0/accounts/#{account_id}/\" \\\n  \"lists/#{list_id}/custom_fields/#{custom_field_id}\"\n) do |req|\n  req.headers = headers\nend\nputs response.status\n"
      responses:
        '200':
          description: The custom field was deleted successfully
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '410':
          $ref: '#/components/responses/BlockedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      operationId: deleteCustomField
    patch:
      summary: Update custom field
      description: "This endpoint is used to update the information for the specified custom field. See <a href=\"https://help.aweber.com/entries/21749682-why-could-changing-my-custom-field-names-cause-problems\"\n target=\"_blank\">Why could changing my custom field names cause problems</a>\nbefore changing the name of a Custom Field.\n\nCheck out related examples:\n\n  * Manage Custom Fields (\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/python/manage-custom-fields\" target=\"_blank\">Python</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/php/manage-custom-fields\" target=\"_blank\">PHP</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/postman/Manage%20Custom%20Fields.postman_collection.json\" target=\"_blank\">Postman</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/csharp/AWeber.Examples.ManageCustomFields\" target=\"_blank\">C#.NET</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/ruby/manage_custom_fields.rb\" target=\"_blank\">Ruby</a> |\n    <a href=\"https://github.com/aweber/public-api-examples/blob/master/node/manage-custom-fields.js\" target=\"_blank\">Node.js</a> )"
      tags:
      - Custom Fields
      parameters:
      - $ref: '#/components/parameters/accountId'
      - $ref: '#/components/parameters/listId'
      - $ref: '#/components/parameters/customFieldId'
      security:
      - OAuth 2.0:
        - list.write
      x-code-samples:
      - lang: Shell
        source: "curl -X PATCH \\\n  https://api.aweber.com/1.0/accounts/{accountId}/lists/{listId}/custom_fields/{customFieldId} \\\n  -d is_subscriber_updateable=True \\\n  -d \"name=Favorite Color\" \\\n  -H 'Authorization: Bearer {YOUR_ACCESS_TOKEN}'\n"
      - lang: Python
        source: "body = {\n    'name': 'Favorite Color',\n    'is_subscriber_updateable': True,\n}\nheaders = {'Content-Type': 'application/json',\n           'Accept': 'application/json',\n           'User-Agent': 'AWeber-Python-code-sample/1.0',\n           'Authorization': f'Bearer {access_token}'}\nurl = (f'https://api.aweber.com/1.0/accounts/{account_id}'\n       f'/lists/{list_id}/custom_fields/{custom_field_id}')\nresponse = requests.patch(url, headers=headers, json=body)\nprint(response.json())\n"
      - lang: PHP
        source: "$body = [\n    'name' => 'Favorite Color',\n    'is_subscriber_updateable' => true,\n];\n$headers = [\n    'Content-Type' => 'application/json',\n    'Accept' => 'application/json',\n    'Authorization' => 'Bearer $token',\n    'User-Agent' => 'AWeber-PHP-code-sample/1.0'\n];\n$url = \"https://api.aweber.com/1.0/accounts/{$accountId}/lists/{$listId}/custom_fields/{$customFieldId}\";\n$response = $client->patch($url, ['json' => $body, 'headers' => $headers]);\n$body = json_decode($response->getbody(), true);\nprint_r($body);\n"
      - lang: C#
        source: "const string url = \"https://api.aweber.com/1.0/accounts/{accountId}/lists/{listId}/custom_fields/{customFieldId}\";\nvar payload = new Dictionary<string, string>\n{\n  {\"is_subscriber_updateable\", \"true\"},\n  {\"name\", \"Favorite Color\"}\n};\nvar request = new HttpRequestMessage(HttpMethod.Patch, url);\nrequest.Content = JsonConvert.SerializeObject(payload);\nrequest.Headers.Add(\"Accept\",\"application/json\");\nrequest.Headers.Add(\"User-Agent\",\"AWeber-CSharp-code-sample/1.0\");\nrequest.Headers.Add(\"Authorization\", $\"Bearer {Token}\");\nvar response = await Client.SendAsync(request);\nConsole.Write(response.Content.ReadAsStringAsync());\n"
      - lang: JavaScript
        label: Node.js
        source: "const headers = {\n  \"Accept\": \"application/json\",\n  \"Content-Type\": \"application/json\",\n  \"User-Agent\": \"AWeber-Node-code-sample/1.0\",\n  \"Authorization\": `Bearer ${accessToken}`\n};\nconst body = JSON.stringify({\n  \"name\": \"Favorite Color\",\n  \"is_subscriber_updateable\": true\n});\nconst url = `https://api.aweber.com/1.0/accounts/${accountId}/lists/${listId}/custom_fields/${customFieldId}`;\nfetch(url, { headers: headers, method: \"PATCH\", body: body })\n  .then(response => response.json())\n  .then(data => {\n    console.log(data)\n})\n"
      - lang: Ruby
        source: "headers = {\n  'Accept': 'application/json',\n  'Content-Type': 'application/json',\n  'User-Agent': 'AWeber-Ruby-code-sample/1.0',\n  'Authorization': \"Bearer #{access_token}\"\n}\nbody = {\n  'name': 'Favorite Color',\n  'is_subscriber_updateable': true\n}\nresponse = Faraday.patch(\n  \"https://api.aweber.com/1.0/accounts/#{account_id}/\" \\\n  \"lists/#{list_id}/custom_fields/#{custom_field_id}\"\n) do |req|\n  req.headers = headers\n  req.body = body.to_json\nend\nputs response.body\n"
      responses:
        '209':
          description: The custom field was updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomField'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFound'
        '410':
          $ref: '#/components/responses/BlockedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  description: The name of the custom field
                  type: string
                  example: Favorite color
                is_subscriber_updateable:
                  description: Whether the subscriber is allowed to update the custom field
                  type: boolean
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                name:
                  description: The name of the custom field
                  type: string
                  example: Favorite color
                is_subscriber_updateable:
                  description: Whether the subscriber is allowed to update the custom field
                  type: boolean
            example: name=foo&is_subscriber_updateable=true
        description: Request Body
        required: true
      operationId: updateCustomField
components:
  parameters:
    listId:
      name: listId
      in: path
      description: The list ID
      required: true
      schema:
        type: integer
        format: int32
    wsStart:
      name: ws.start
      in: query
      description: The pagination starting offset
      schema:
        type: integer
        format: int32
        minimum: 0
        default: 0
    wsSize:
      name: ws.size
      in: query
      description: The pagination total entries to retrieve
      schema:
        type: integer
        format: int32
        minimum: 

# --- truncated at 32 KB (46 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/aweber/refs/heads/main/openapi/aweber-custom-fields-api-openapi.yml