Articles API
The Articles API provides endpoints for managing articles (content) in Joomla.
Base URL
/api/index.php/v1/content/articles
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
| GET | /content/articles | Retrieve all articles |
| GET | /content/articles/{id} | Retrieve specific article |
| POST | /content/articles | Create new article |
| PATCH | /content/articles/{id} | Update article |
| DELETE | /content/articles/{id} | Delete article |
Retrieve all articles
GET /api/index.php/v1/content/articles
Response
{
"data": [
{
"type": "articles",
"id": "1",
"attributes": {
"title": "Welcome to Joomla",
"alias": "welcome-to-joomla",
"introtext": "This is the introduction...",
"fulltext": "This is the full text...",
"state": 1,
"catid": 2,
"created": "2024-01-01 12:00:00",
"created_by": 42,
"modified": "2024-10-26 10:30:00"
}
}
],
"meta": {
"total-pages": 5
}
}
Retrieve specific article
GET /api/index.php/v1/content/articles/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
| id | integer | Article ID |
Example
curl -X GET "https://yoursite.com/api/index.php/v1/content/articles/1" \
-H "X-Joomla-Token: YOUR_API_TOKEN"
Create article
POST /api/index.php/v1/content/articles
Request Body
{
"title": "New article",
"alias": "new-article",
"introtext": "This is the introduction of the new article",
"fulltext": "This is the full text of the new article",
"catid": 2,
"state": 1,
"access": 1,
"language": "*"
}
Required fields
| Field | Type | Description |
|---|---|---|
| title | string | Article title |
| catid | int | Category ID |
Optional fields
| Field | Type | Default | Description |
|---|---|---|---|
| alias | string | auto | URL-friendly name |
| introtext | string | "" | Introduction text |
| fulltext | string | "" | Full text |
| state | int | 1 | Publication status |
| access | int | 1 | Access level |
| language | string | "*" | Language code or * for all |
| featured | int | 0 | Featured article |
| metadesc | string | "" | Meta description |
| metakey | string | "" | Meta keywords |
Example
curl -X POST "https://yoursite.com/api/index.php/v1/content/articles" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "New article",
"alias": "new-article",
"introtext": "Introduction text",
"fulltext": "Full text",
"catid": 2,
"state": 1
}'
Update article
PATCH /api/index.php/v1/content/articles/{id}
Request Body
Only the fields you want to change:
{
"title": "Updated title",
"state": 0
}
Example
curl -X PATCH "https://yoursite.com/api/index.php/v1/content/articles/1" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated title"
}'
Delete article
DELETE /api/index.php/v1/content/articles/{id}
Example
curl -X DELETE "https://yoursite.com/api/index.php/v1/content/articles/1" \
-H "X-Joomla-Token: YOUR_API_TOKEN"
Note
Deleting an article moves it to the trash (state = -2).
Article States
| Value | Status |
|---|---|
| -2 | Trash |
| 0 | Unpublished |
| 1 | Published |
| 2 | Archived |
Filtering
By category
GET /api/index.php/v1/content/articles?filter[category]=2
By status
GET /api/index.php/v1/content/articles?filter[state]=1
By author
GET /api/index.php/v1/content/articles?filter[author]=42
Search
GET /api/index.php/v1/content/articles?filter[search]=joomla
Related Endpoints
- Categories API - Category management
- Tags API - Link tags to articles