Create API
POST https://api.getpostman.com/apis?workspaceId={{workspaceId}}
Create API
Creates a new API in either your newly generated Workspace, or in your existing Workspace you've specified.
Overview
Body
The Request body should contain an object which should have the following keys:
name
— A string that contains the Workspace's name (value is required).summary
— A string that contains the Workspace's summary.description
— A string that contains the Workspace's description.
Pre-request Script tab
Sends a message to the Console that the Request is starting to create a new API.
Tests tab
- Checks for a 201 HTTP response to confirm that the new API has been created.
- Parse the Response.
- Validates data format returned from the newly created API.
- Sets the new ID as the value for
apiId
Collection Variable.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
workspaceId | string |
Request Body
{"name"=>"Scaffolded API: {{$randomNoun}} | {{today}}", "summary"=>"{{$randomJobTitle}}", "description"=>"{{$randomJobDescriptor}}"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"api":{"id":"387c2863-6ee3-4a56-8210-225f774edade","name":"Sync API","summary":"This is a summary","description":"This is supposed to handle markdown *descriptions*.","createdBy":"5665","createdAt":"2019-02-12 19:34:49","updatedAt":"2019-02-12 19:34:49"}}