Skip to main content

Contacts API

The Contacts API provides endpoints for managing contacts in Joomla.

Base URL

/api/index.php/v1/contact

Endpoints Overview

MethodEndpointDescription
GET/contactRetrieve all contacts
GET/contact/{id}Retrieve specific contact
POST/contactCreate new contact
PATCH/contact/{id}Update contact
DELETE/contact/{id}Delete contact

Retrieve all contacts

GET /api/index.php/v1/contact

Response

{
"data": [
{
"type": "contacts",
"id": "1",
"attributes": {
"name": "John Smith",
"alias": "john-smith",
"con_position": "Manager",
"address": "Main Street 1",
"suburb": "Amsterdam",
"state": "North Holland",
"country": "Netherlands",
"postcode": "1000 AA",
"telephone": "020-1234567",
"mobile": "06-12345678",
"email_to": "john@example.com",
"webpage": "https://example.com",
"published": 1,
"catid": 4
}
}
]
}

Retrieve specific contact

GET /api/index.php/v1/contact/{id}

Parameters

ParameterTypeDescription
idintegerContact ID

Example

curl -X GET "https://yoursite.com/api/index.php/v1/contact/1" \
-H "X-Joomla-Token: YOUR_API_TOKEN"

Create contact

POST /api/index.php/v1/contact

Request Body

{
"name": "Peter Johnson",
"alias": "peter-johnson",
"con_position": "Director",
"address": "Village Street 10",
"suburb": "Utrecht",
"telephone": "030-9876543",
"mobile": "06-98765432",
"email_to": "peter@example.com",
"webpage": "https://johnson.com",
"catid": 4,
"published": 1,
"access": 1,
"language": "*"
}

Required fields

FieldTypeDescription
namestringContact name
catidintCategory ID

Optional fields

FieldTypeDefaultDescription
aliasstringautoURL-friendly name
con_positionstring""Job position
addressstring""Address
suburbstring""City
statestring""Province/State
countrystring""Country
postcodestring""Postal code
telephonestring""Phone number
mobilestring""Mobile number
faxstring""Fax number
email_tostring""Email address
webpagestring""Website URL
publishedint1Publication status
accessint1Access level
languagestring"*"Language code

Example

curl -X POST "https://yoursite.com/api/index.php/v1/contact" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Peter Johnson",
"email_to": "peter@example.com",
"telephone": "030-9876543",
"catid": 4
}'

Update contact

PATCH /api/index.php/v1/contact/{id}

Request Body

{
"telephone": "030-1111111",
"email_to": "new@example.com"
}

Example

curl -X PATCH "https://yoursite.com/api/index.php/v1/contact/1" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"telephone": "030-1111111"
}'

Delete contact

DELETE /api/index.php/v1/contact/{id}

Example

curl -X DELETE "https://yoursite.com/api/index.php/v1/contact/1" \
-H "X-Joomla-Token: YOUR_API_TOKEN"

Contact States

ValueStatus
-2Trash
0Unpublished
1Published
2Archived

Contact Categories

Contacts are organized in categories. The default is category ID 4.

Retrieve categories

GET /api/index.php/v1/contact/categories

Filtering

By category

GET /api/index.php/v1/contact?filter[catid]=4

By publication status

GET /api/index.php/v1/contact?filter[published]=1
GET /api/index.php/v1/contact?filter[search]=john

Custom Fields

Contacts support custom fields. These are available via separate endpoints:

  • GET /api/index.php/v1/fields/contact/contact - Retrieve contact fields
  • POST /api/index.php/v1/fields/contact/contact - Create contact field