Skip to main content

Strapi REST API (4.3.9)

Download OpenAPI specification:Download

The REST API allows accessing the content-types through API endpoints. Strapi automatically creates API endpoints when a content-type is created. API parameters can be used when querying API endpoints to refine the results.

Posts

Return a post

Return a post with postId equals to id.

path Parameters
id
required
string

The postId requested by user.

Responses

Response samples

Content type
application/json
{
  • "userId": 1,
  • "id": 1,
  • "title": "The First Post",
  • "body": "we are building a blog post API using OpenAPI Specification."
}

Update a post

A complete replacement of a post with id.

path Parameters
id
required
string

The postId requested by user.

Request Body schema: application/json
id
required
string

The post id.

userId
required
string

The post userId.

title
required
string

The title of the post

body
required
string

The body content of the post

Responses

Request samples

Content type
application/json
{
  • "userId": 1,
  • "id": 1,
  • "title": "The First Post",
  • "body": "we are building a blog post API using OpenAPI Specification."
}

Update a post

Update the post with id partially.

path Parameters
id
required
string

The postId requested by user.

Request Body schema: application/json
id
string

The post id.

userId
string

The post userId.

title
string

The title of the post

body
string

The body content of the post

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "userId": "string",
  • "title": "string",
  • "body": "string"
}

Deletes a post

Deletes the post with id.

path Parameters
id
required
string

The postId requested by user.

Responses

Comments

Return comments

Return comments on a post with postId={id}.

query Parameters
postId
string

The postId which we want the comments

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]