I was working on my first API integration, and I kept hearing the term "payload." "Send the payload in the request body." "The response contains a JSON payload." I nodded along, but honestly? I had no idea what a payload actually was.
I thought it was some technical term I'd never understand. Turns out, it's actually pretty simple. A payload is just the data you're sending or receiving. That's it. The fancy name makes it sound complicated, but it's really just the JSON data traveling between applications.
If you have searched “what is payload in API” docs, it is the body of the request or response — not the headers or URL. When that body is JSON, it is a JSON payload (also called payload JSON, an API payload, or JSON payloads). You can pretty print or minify JSON in a JSON payload with the free formatter, or inspect the JSON payload inside a JWT.
What Is a Payload in an API?
Think of a payload like the contents of a package you're mailing. When you send a package, you have:
- The box (the HTTP request/response)
- The address label (the headers)
- The contents (the payload)
The payload is the actual data—the stuff that matters. Everything else (headers, status codes, URLs) is just packaging.
In API terms, a payload is the data sent in the body of an HTTP request or response. When that data is in JSON format, it's called a JSON payload.
JSON Payloads in API Requests
When you make an API request, you often send data along with it. That data is the payload.
GET Requests (Usually No Payload)
GET requests typically don't have a payload. You're just asking for data:
// GET request - no payload
fetch('https://api.example.com/users/123')
The data you want is usually in the URL or query parameters, not in the body.
POST/PUT/PATCH Requests (Have Payloads)
When you're creating or updating data, you send a payload:
// POST request - has a JSON payload
fetch('https://api.example.com/users', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "John",
email: "john@example.com",
age: 30
})
})
That object you're sending? That's your JSON payload. It's the data you want to create or update.
JSON Payloads in API Responses
When an API responds, it often sends data back. That data is also a payload:
const response = await fetch('https://api.example.com/users/123');
const data = await response.json(); // This is the JSON payload
console.log(data.name); // "John"
The API sends back a JSON payload containing the user data.
Sample JSON Payload
Here is a sample JSON payload (payload JSON) you can paste into the JSON Formatter to pretty print, minify JSON, or validate JSON:
{
"orderId": "ord_1842",
"customer": { "id": 42, "email": "ada@example.com" },
"items": [{ "sku": "USB-C-HUB", "qty": 2, "price": 24.5 }],
"paid": true
}
That API payload is the JSON body an order endpoint would accept or return. Nested objects and arrays inside JSON payloads are still one payload.
Real-World Examples
Let me show you some real examples:
Example 1: Creating a User
Request Payload (what you send):
{
"name": "John Doe",
"email": "john@example.com",
"password": "secret123"
}
Response Payload (what you get back):
{
"id": 12345,
"name": "John Doe",
"email": "john@example.com",
"created_at": "2025-01-21T10:30:00Z"
}
The request payload contains the data you want to create. The response payload contains the created user (often with additional fields like ID and timestamps).
Example 2: Updating a User
Request Payload:
{
"name": "John Smith",
"age": 31
}
You're sending only the fields you want to update. The API uses this payload to update the user.
Response Payload:
{
"id": 12345,
"name": "John Smith",
"email": "john@example.com",
"age": 31,
"updated_at": "2025-01-21T11:00:00Z"
}
The response shows the updated user data.
Example 3: Getting a List
Request: No payload (it's a GET request)
Response Payload:
{
"users": [
{
"id": 1,
"name": "John",
"email": "john@example.com"
},
{
"id": 2,
"name": "Jane",
"email": "jane@example.com"
}
],
"total": 2,
"page": 1
}
The response payload contains the list of users plus metadata.



