> ## 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.

# Create Contact Property

> Create a new contact property to store additional contact attributes using the AutoSend API.

```bash cURL theme={null}
curl --request POST \
  --url https://api.autosend.com/v1/contact-properties \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "company",
    "type": "string"
  }'
```

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

url = "https://api.autosend.com/v1/contact-properties"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

payload = {
    "name": "company",
    "type": "string"
}

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

```javascript JavaScript theme={null}
const response = await fetch("https://api.autosend.com/v1/contact-properties", {
  method: "POST",
  headers: {
    Authorization: "Bearer <token>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "company",
    type: "string",
  }),
});

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/contact-properties",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => json_encode([
    "name" => "company",
    "type" => "string",
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json",
  ],
]);

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

echo $response;
```

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

import (
  "bytes"
  "encoding/json"
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  payload, _ := json.Marshal(map[string]string{
    "name": "company",
    "type": "string",
  })

  req, _ := http.NewRequest("POST", "https://api.autosend.com/v1/contact-properties", bytes.NewBuffer(payload))
  req.Header.Set("Authorization", "Bearer <token>")
  req.Header.Set("Content-Type", "application/json")

  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();

    String body = """
      {
        "name": "company",
        "type": "string"
      }
      """;

    HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.autosend.com/v1/contact-properties"))
      .header("Authorization", "Bearer <token>")
      .header("Content-Type", "application/json")
      .POST(HttpRequest.BodyPublishers.ofString(body))
      .build();

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

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

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

request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  name: "company",
  type: "string"
})

response = http.request(request)
puts response.body
```

```json Response theme={null}
{
  "success": true,
  "message": "Contact property created successfully",
  "data": {
    "id": "6960953e729f65f154369408",
    "name": "company",
    "type": "string",
    "fieldName": "company",
    "fieldType": "string",
    "createdAt": "2026-01-09T05:42:22.171Z",
    "updatedAt": "2026-01-09T05:42:22.171Z"
  }
}
```

### Authorizations

**Authorizations** `string | header` *required*

Bearer authentication header of the form Bearer `<token>`, where `<token>` is your auth token.

#### Body Parameters

**name** `string` *required*

The programmatic name for the contact property. Must be unique within the project. Cannot be one of the reserved names: `firstName`, `first_name`, `lastName`, `last_name`, `email`, `mobile`, `unsubscribed`, `unsubscribe`, `unsubscribe_groups`, `unsubscribe_preferences`, `userId`, `externalId`, `createdAt`, `updatedAt`, `contactLists`, `address`, `address_line_1`, `address_line_2`, `city`, `state`, `zip`, `country`.

The legacy `fieldName` parameter is still accepted as an alias for `name`.

**type** `string` *required*

The data type of the contact property. Must be one of: `string`, `number`, `boolean`, `date`.

The legacy `fieldType` parameter is still accepted as an alias for `type`.

**description** `string`

A human-readable description of what the property represents.

**defaultValue** `string`

A fallback value used when a contact does not have an explicit value for this property.

### Response

Contact property created successfully

**success** `boolean`

Indicates whether the request was successful.

**message** `string`

Confirmation message.

Example: `"Contact property created successfully"`

**data** `object`

The created contact property.

**data**

**data.id** `string`

Unique identifier of the contact property.

**data.name** `string`

The programmatic name of the contact property.

**data.type** `string`

The data type: `string`, `number`, `boolean`, or `date`.

**data.fieldName** `string`

Legacy alias of `name`, returned for backward compatibility.

**data.fieldType** `string`

Legacy alias of `type`, returned for backward compatibility.

**data.createdAt** `string`

ISO 8601 timestamp when the property was created.

**data.updatedAt** `string`

ISO 8601 timestamp when the property was last updated.


## OpenAPI

````yaml POST /contact-properties
openapi: 3.1.0
info:
  title: Contact Properties API
  description: >-
    API for managing contact properties in an Autosend project. Contact
    properties let you define dynamic attributes that are attached to every
    contact in your project. Reserved built-in property names cannot be used
    when creating contact properties. Contact properties were previously called
    custom fields; the `/custom-fields` endpoints remain available as a
    deprecated alias.
  version: 1.0.0
servers:
  - url: https://api.autosend.com/v1
security:
  - bearerAuth: []
paths:
  /contact-properties:
    post:
      summary: Create Contact Property
      description: >-
        Creates a new contact property for the authenticated project. The `name`
        must be unique within the project and must not conflict with any
        reserved built-in property name. The legacy `fieldName`/`fieldType` body
        parameters are still accepted as aliases for `name`/`type`.
components: {}

````

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