Skip to content

Example of an OpenAPI document with different types of parameters.

Servers

https://api.example.com

List users

GET
/users

Returns a list of users with optional filtering.

Parameters

Header Parameters

X-API-Key*

API key for authentication

Typestring
Required
Example"api-key-123"

Query Parameters

name

Filter users by name

Typestring
Example"John"
age

Filter users by age

Typeinteger
Example25
Minimum0
Maximum120
Multiple of1
limit

Maximum number of users to return

Typeinteger
Example10
Minimum1
Maximum100
Default20
offset

Number of users to skip for pagination

Typeinteger
Example0
Minimum0
Default0

Responses

Successful response

application/json
object
object[]

Playground

Headers
Variables
Key
Value

Samples

cURL
JavaScript
PHP
Python

Create a new user

POST
/users

Creates a new user with the provided information.

Parameters

Header Parameters

X-API-Key*

API key for authentication

Typestring
Required
Example"api-key-123"
X-Request-ID

Unique request identifier for tracing

Typestring
Example"123e4567-e89b-12d3-a456-426614174000"
Format"uuid"

Query Parameters

dryRun

If true, validates the request without creating the user

Typeboolean
Defaultfalse
region

Region for user creation

Typestring
Valid values
"us-east""us-west""eu-central"
Default"us-east"

Request Body

application/json
object

User's full name

Min Length2
Max Length100

User's email address

Format"email"

User's age in years

Minimum18
Maximum120
object

User's address information

string[]

User's preferences

object

Additional user metadata

Responses

User created successfully

application/json
object

The ID of the newly created user

Format"date-time"

Playground

Headers
Variables
Key
Value
Body

Samples

cURL
JavaScript
PHP
Python

Get user information by ID

GET
/users/{userId}

Returns information for a specific user.

Parameters

Header Parameters

X-Custom-Header

A custom header for testing purposes

Typestring
Example"custom-value"
Min Length3
Max Length50
Pattern"^[a-zA-Z0-9-]+$"

Path Parameters

userId*

The ID of the user

Typestring
Required
Example"123"

Query Parameters

age

The age of the user to filter

Typeinteger
Example25
Minimum0
Maximum120
Multiple of1
acceptsCookies*

Whether the user accepts cookies

Typeboolean
Required
Exampletrue
isSubscribed

Whether the user is subscribed to the newsletter

Typeboolean
Examplefalse

Responses

Successful response

application/json
object

Playground

Headers
Variables
Key
Value

Samples

cURL
JavaScript
PHP
Python

Update document content

PUT
/documents/{documentId}

Updates an existing document with plain text content.

Parameters

Header Parameters

X-API-Key*

API key for authentication

Typestring
Required
Example"api-key-123"
X-Transaction-ID

Unique transaction identifier for tracing

Typestring
Example"123e4567-e89b-12d3-a456-426614174000"
Format"uuid"

Path Parameters

documentId*

The ID of the document to update

Typestring
Required
Example"doc-123"

Query Parameters

version

Document version for concurrency control

Typeinteger
Example2
Minimum1
overwrite

If true, completely overwrites the document instead of merging changes

Typeboolean
Defaultfalse
format

Format of the document content

Typestring
Valid values
"plain""markdown""html"
Default"plain"
tags

Tags to associate with the document

Typearray
Example"important""draft"

Request Body

text/plain

Responses

Document updated successfully

application/json
object
Format"date-time"

Size of the document in bytes

Playground

Headers
Variables
Key
Value
Body

Samples

cURL
JavaScript
PHP
Python

Powered by VitePress OpenAPI