Skip to content

Contacts API

Shared contact directory for SMS, Email and other services. Manage contacts and groups for batch operations.

Base URL: https://api.wayscloud.services

Endpoints

MethodPathDescription
GET/v1/contactsList contacts
POST/v1/contactsCreate contact
GET/v1/contacts/{contact_id}Get contact
PATCH/v1/contacts/{contact_id}Update contact
DELETE/v1/contacts/{contact_id}Delete contact
POST/v1/contacts/{contact_id}/gdpr-deleteGDPR anonymize contact
GET/v1/contacts/groupsList contact groups
POST/v1/contacts/groupsCreate contact group
GET/v1/contacts/groups/{group_id}Get contact group
PATCH/v1/contacts/groups/{group_id}Update contact group
DELETE/v1/contacts/groups/{group_id}Delete contact group
GET/v1/contacts/groups/{group_id}/membersList group members
POST/v1/contacts/groups/{group_id}/membersAdd members to group
DELETE/v1/contacts/groups/{group_id}/members/{contact_id}Remove member from group

GET /v1/contacts

List contacts

List all contacts with optional filtering by type, search query, or tags.

Response:

FieldTypeDescription
contactsarray
totalinteger
pageinteger
per_pageinteger

Example:

bash
curl https://api.wayscloud.services/v1/contacts \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET"

Response:

json
{
  "contacts": [
    {
      "id": "a1b2c3d4-5678-9abc-def0-123456789abc",
      "first_name": "Ola",
      "last_name": "Nordmann",
      "email": "ola@example.com",
      "phone_number": "+4799999999",
      "contact_type": "person",
      "tags": [
        "vip"
      ]
    }
  ],
  "total": 1,
  "page": 1,
  "per_page": 50
}

POST /v1/contacts

Create contact

Create a new contact. Phone numbers should be in E.164 format for SMS sending.

Request Body:

FieldTypeDescription
typestringValues: person, company
namestringRequired.
company_namestring
phone_numberstringE.164 format recommended
emailstring
tagsarray
notesstring

Example:

json
{
  "type": "person",
  "name": "Ola Nordmann",
  "phone_number": "+4799999999",
  "email": "ola@example.com",
  "tags": [
    "vip"
  ]
}

Response:

FieldTypeDescription
idstring
typestringValues: person, company
namestring
company_namestring
phone_numberstring
emailstring
tagsarray
notesstring
created_atstring
updated_atstring

Example:

bash
curl -X POST https://api.wayscloud.services/v1/contacts \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "person",
  "name": "Ola Nordmann",
  "phone_number": "+4799999999",
  "email": "ola@example.com",
  "tags": [
    "vip"
  ]
}'

Response:

json
{
  "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "type": "person",
  "name": "Ola Nordmann",
  "company_name": "ACME AS",
  "phone_number": "+4799999999",
  "email": "ola@example.com",
  "tags": [
    "vip",
    "newsletter"
  ],
  "notes": "Key contact for project X",
  "created_at": "2025-01-15T09:30:00Z",
  "updated_at": "2025-01-15T09:30:00Z"
}

GET /v1/contacts/

Get contact

Get details of a specific contact.

Response:

FieldTypeDescription
idstring
typestringValues: person, company
namestring
company_namestring
phone_numberstring
emailstring
tagsarray
notesstring
created_atstring
updated_atstring

Example:

bash
curl https://api.wayscloud.services/v1/contacts/{contact_id} \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET"

Response:

json
{
  "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "type": "person",
  "name": "Ola Nordmann",
  "company_name": "ACME AS",
  "phone_number": "+4799999999",
  "email": "ola@example.com",
  "tags": [
    "vip",
    "newsletter"
  ],
  "notes": "Key contact for project X",
  "created_at": "2025-01-15T09:30:00Z",
  "updated_at": "2025-01-15T09:30:00Z"
}

PATCH /v1/contacts/

Update contact

Update an existing contact. Only provided fields are updated.

Request Body:

FieldTypeDescription
typestringValues: person, company
namestringRequired.
company_namestring
phone_numberstringE.164 format recommended
emailstring
tagsarray
notesstring

Example:

json
{
  "type": "person",
  "name": "Ola Nordmann",
  "phone_number": "+4799999999",
  "email": "ola@example.com",
  "tags": [
    "vip"
  ]
}

Response:

FieldTypeDescription
idstring
typestringValues: person, company
namestring
company_namestring
phone_numberstring
emailstring
tagsarray
notesstring
created_atstring
updated_atstring

Example:

bash
curl -X PATCH https://api.wayscloud.services/v1/contacts/{contact_id} \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "person",
  "name": "Ola Nordmann",
  "phone_number": "+4799999999",
  "email": "ola@example.com",
  "tags": [
    "vip"
  ]
}'

Response:

json
{
  "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "type": "person",
  "name": "Ola Nordmann",
  "company_name": "ACME AS",
  "phone_number": "+4799999999",
  "email": "ola@example.com",
  "tags": [
    "vip",
    "newsletter"
  ],
  "notes": "Key contact for project X",
  "created_at": "2025-01-15T09:30:00Z",
  "updated_at": "2025-01-15T09:30:00Z"
}

DELETE /v1/contacts/

Delete contact

Delete a contact. This is a soft delete - the contact can be restored via GDPR endpoints.

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/contacts/{contact_id} \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET"

POST /v1/contacts/{contact_id}/gdpr-delete

GDPR anonymize contact

Permanently anonymize contact data for GDPR compliance. This is irreversible.

Request Body:

FieldTypeDescription
reasonstringRequired. Reason for GDPR deletion

Example:

bash
curl -X POST https://api.wayscloud.services/v1/contacts/{contact_id}/gdpr-delete \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "Customer requested data deletion per GDPR Article 17"
}'

GET /v1/contacts/groups

List contact groups

List all contact groups with member counts.

Response:

FieldTypeDescription
groupsarray

Example:

bash
curl https://api.wayscloud.services/v1/contacts/groups \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET"

Response:

json
{
  "groups": [
    {
      "id": "a1b2c3d4-1234-5678-9abc-def012345678",
      "name": "Newsletter Subscribers",
      "member_count": 150,
      "created_at": "2025-01-15T09:30:00Z"
    }
  ]
}

POST /v1/contacts/groups

Create contact group

Create a new contact group for organizing contacts.

Request Body:

FieldTypeDescription
namestringRequired.
descriptionstring

Example:

json
{
  "name": "VIP Customers",
  "description": "High-value customers for priority support"
}

Response:

FieldTypeDescription
idstring
namestring
descriptionstring
member_countinteger
created_atstring

Example:

bash
curl -X POST https://api.wayscloud.services/v1/contacts/groups \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "VIP Customers",
  "description": "High-value customers for priority support"
}'

Response:

json
{
  "id": "a1b2c3d4-1234-5678-9abc-def012345678",
  "name": "Newsletter Subscribers",
  "description": "Customers who opted in for newsletter",
  "member_count": 150,
  "created_at": "2025-01-15T09:30:00Z"
}

GET /v1/contacts/groups/

Get contact group

Get details of a specific contact group including member list.

Response:

FieldTypeDescription
idstring
namestring
descriptionstring
member_countinteger
created_atstring

Example:

bash
curl https://api.wayscloud.services/v1/contacts/groups/{group_id} \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET"

Response:

json
{
  "id": "a1b2c3d4-1234-5678-9abc-def012345678",
  "name": "Newsletter Subscribers",
  "description": "Customers who opted in for newsletter",
  "member_count": 150,
  "created_at": "2025-01-15T09:30:00Z"
}

PATCH /v1/contacts/groups/

Update contact group

Update group name or description.

Request Body:

FieldTypeDescription
namestringRequired.
descriptionstring

Example:

json
{
  "name": "VIP Customers",
  "description": "High-value customers for priority support"
}

Response:

FieldTypeDescription
idstring
namestring
descriptionstring
member_countinteger
created_atstring

Example:

bash
curl -X PATCH https://api.wayscloud.services/v1/contacts/groups/{group_id} \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "VIP Customers",
  "description": "High-value customers for priority support"
}'

Response:

json
{
  "id": "a1b2c3d4-1234-5678-9abc-def012345678",
  "name": "Newsletter Subscribers",
  "description": "Customers who opted in for newsletter",
  "member_count": 150,
  "created_at": "2025-01-15T09:30:00Z"
}

DELETE /v1/contacts/groups/

Delete contact group

Delete a contact group. Contacts in the group are not deleted.

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/contacts/groups/{group_id} \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET"

GET /v1/contacts/groups/{group_id}/members

List group members

List all contacts in a group.

Response:

FieldTypeDescription
membersarray

Example:

bash
curl https://api.wayscloud.services/v1/contacts/groups/{group_id}/members \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET"

Response:

json
{
  "members": [
    {
      "id": "b2c3d4e5-6789-0abc-def1-234567890abc",
      "first_name": "Ola",
      "last_name": "Nordmann",
      "phone_number": "+4799999999"
    }
  ]
}

POST /v1/contacts/groups/{group_id}/members

Add members to group

Add one or more contacts to a group.

Request Body:

FieldTypeDescription
contact_idsarrayRequired.

Response:

FieldTypeDescription
addedinteger

Example:

bash
curl -X POST https://api.wayscloud.services/v1/contacts/groups/{group_id}/members \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "contact_ids": [
    "a1b2c3d4-5678-9abc-def0-123456789abc",
    "b2c3d4e5-6789-0abc-def1-234567890abc"
  ]
}'

Response:

json
{
  "added": 3
}

DELETE /v1/contacts/groups/{group_id}/members/

Remove member from group

Remove a contact from a group.

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/contacts/groups/{group_id}/members/{contact_id} \
  -H "X-API-Key: wayscloud_pat_abc12_YOUR_SECRET"

WAYSCloud AS