Create Phone

post/v1/phones

Create a new phone number with relationships to people, companies, or workspaces

Requires a bearer token: Authorization: Bearer <token>.

Request

cURL
curl -X POST https://api.wellapp.ai/v1/phones \
  -H "Authorization: Bearer $WELL_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "data": {
    "type": "phone",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "attributes": {
      "country_code": 1,
      "national_number": "4155552671",
      "e164_number": "+14155552671",
      "label": "work",
      "is_primary": true,
      "is_verified": true,
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    },
    "relationships": {
      "persons": {
        "data": [
          {
            "type": "people",
            "id": "people1"
          }
        ]
      },
      "companies": {
        "data": [
          {
            "type": "company",
            "id": "company_tenant"
          }
        ]
      },
      "workspaces": {
        "data": [
          {
            "type": "workspace",
            "id": "workspace_sales"
          },
          {
            "type": "workspace",
            "id": "550e8400-e29b-41d4-a716-446655440000"
          }
        ]
      }
    }
  },
  "included": [
    {
      "type": "people",
      "id": "people1",
      "attributes": {
        "first_name": "John",
        "last_name": "Doe",
        "full_name": "John Doe",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z"
      }
    },
    {
      "type": "company",
      "id": "company_tenant",
      "attributes": {
        "name": "Acme Corporation",
        "description": "Leading technology company",
        "locale": "en",
        "domain_name_primary_link_url": "acme.com",
        "created_at": "2023-12-01T09:00:00Z",
        "updated_at": "2023-12-01T09:00:00Z"
      }
    },
    {
      "type": "workspace",
      "id": "workspace_sales",
      "attributes": {
        "name": "Sales Team Workspace",
        "description": "Workspace for sales activities",
        "avatar_color": "#FF6B35",
        "external_workspace_id": "fygr_123",
        "auto_extract_enabled": true,
        "created_at": "2024-01-10T08:15:00Z",
        "updated_at": "2024-01-10T08:15:00Z"
      }
    },
    {
      "type": "workspace",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "attributes": {
        "name": "Marketing Team Workspace",
        "description": "Workspace for marketing campaigns",
        "avatar_color": "#4A90E2",
        "external_workspace_id": "mkt_workspace_001",
        "auto_extract_enabled": false,
        "created_at": "2024-01-12T14:45:00Z",
        "updated_at": "2024-01-12T14:45:00Z"
      }
    }
  ]
}'
Request body
{
  "data": {
    "type": "phone",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "attributes": {
      "country_code": 1,
      "national_number": "4155552671",
      "e164_number": "+14155552671",
      "label": "work",
      "is_primary": true,
      "is_verified": true,
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    },
    "relationships": {
      "persons": {
        "data": [
          {
            "type": "people",
            "id": "people1"
          }
        ]
      },
      "companies": {
        "data": [
          {
            "type": "company",
            "id": "company_tenant"
          }
        ]
      },
      "workspaces": {
        "data": [
          {
            "type": "workspace",
            "id": "workspace_sales"
          },
          {
            "type": "workspace",
            "id": "550e8400-e29b-41d4-a716-446655440000"
          }
        ]
      }
    }
  },
  "included": [
    {
      "type": "people",
      "id": "people1",
      "attributes": {
        "first_name": "John",
        "last_name": "Doe",
        "full_name": "John Doe",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z"
      }
    },
    {
      "type": "company",
      "id": "company_tenant",
      "attributes": {
        "name": "Acme Corporation",
        "description": "Leading technology company",
        "locale": "en",
        "domain_name_primary_link_url": "acme.com",
        "created_at": "2023-12-01T09:00:00Z",
        "updated_at": "2023-12-01T09:00:00Z"
      }
    },
    {
      "type": "workspace",
      "id": "workspace_sales",
      "attributes": {
        "name": "Sales Team Workspace",
        "description": "Workspace for sales activities",
        "avatar_color": "#FF6B35",
        "external_workspace_id": "fygr_123",
        "auto_extract_enabled": true,
        "created_at": "2024-01-10T08:15:00Z",
        "updated_at": "2024-01-10T08:15:00Z"
      }
    },
    {
      "type": "workspace",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "attributes": {
        "name": "Marketing Team Workspace",
        "description": "Workspace for marketing campaigns",
        "avatar_color": "#4A90E2",
        "external_workspace_id": "mkt_workspace_001",
        "auto_extract_enabled": false,
        "created_at": "2024-01-12T14:45:00Z",
        "updated_at": "2024-01-12T14:45:00Z"
      }
    }
  ]
}

Responses

201Phone created successfully

{
  "data": [
    {
      "type": "phone",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "attributes": {
        "country_code": 1,
        "national_number": "4155552671",
        "e164_number": "+14155552671",
        "label": "work",
        "is_primary": true,
        "is_verified": true,
        "created_at": "2023-11-07T05:31:56Z"
      },
      "relationships": {
        "persons": {
          "data": [
            {
              "type": "people",
              "id": "people1",
              "attributes": {
                "first_name": "John",
                "last_name": "Doe",
                "email": "john.doe@example.com"
              }
            }
          ]
        },
        "companies": {
          "data": [
            {
              "type": "company",
              "id": "company_tenant",
              "attributes": {
                "name": "Acme Corporation",
                "description": "Leading technology company",
                "website": "https://acme.com"
              }
            }
          ]
        },
        "workspaces": {
          "data": [
            {
              "type": "workspace",
              "external_workspace_id": "fygr_123",
              "attributes": {
                "name": "Sales Team Workspace",
                "description": "Workspace for sales activities"
              }
            },
            {
              "type": "workspace",
              "id": "550e8400-e29b-41d4-a716-446655440000",
              "attributes": {
                "name": "Marketing Team Workspace",
                "description": "Workspace for marketing campaigns"
              }
            }
          ]
        }
      }
    }
  ]
}

400Bad request - invalid phone data or validation error

401Unauthorized - invalid API key

404Person not found