Skip to content

addPig

POST
/pigs
curl --request POST \
--url https://example.com/api/pigs \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "type": "berkshire" }'

Creates a new pig

Pig to add

Media typeapplication/json
object
name
string
type

The type of pig to add

string
Allowed values: berkshire tamworth

Animal response

Media typeapplication/json
object
name
required
string
tag
string
id
required
integer format: int64
Examplegenerated
{
"name": "example",
"tag": "example",
"id": 1
}

Unexpected error

Media typeapplication/json
object
code
required
integer format: int32
message
required
string
Examplegenerated
{
"code": 1,
"message": "example"
}