Replace an entry
curl --request PUT \
--url https://api.swapnice.com/v1/entries/{entry_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"ontology": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"entry_name": "<string>",
"fields": {},
"entry_id": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": [
"<string>"
]
}
}
'const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ontology: '<string>',
owner_id: '<string>',
ingestion_origin: '<string>',
entry_name: '<string>',
fields: {},
entry_id: '<string>',
value: 123,
image_upload_status: 'uploaded',
media: {primary_image: '<string>', gallery: ['<string>']}
})
};
fetch('https://api.swapnice.com/v1/entries/{entry_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/entries/{entry_id}"
payload = {
"ontology": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"entry_name": "<string>",
"fields": {},
"entry_id": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": ["<string>"]
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"status": "created",
"entry": {
"entry_id": "<string>",
"ontology": "<string>",
"entry_name": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": [
"<string>"
]
},
"fields": {},
"checksum": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Entries and ontologies
Replace an entry
PUT uses the same validation as create. Identity fields must still match.
PUT
/
v1
/
entries
/
{entry_id}
Replace an entry
curl --request PUT \
--url https://api.swapnice.com/v1/entries/{entry_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"ontology": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"entry_name": "<string>",
"fields": {},
"entry_id": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": [
"<string>"
]
}
}
'const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ontology: '<string>',
owner_id: '<string>',
ingestion_origin: '<string>',
entry_name: '<string>',
fields: {},
entry_id: '<string>',
value: 123,
image_upload_status: 'uploaded',
media: {primary_image: '<string>', gallery: ['<string>']}
})
};
fetch('https://api.swapnice.com/v1/entries/{entry_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/entries/{entry_id}"
payload = {
"ontology": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"entry_name": "<string>",
"fields": {},
"entry_id": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": ["<string>"]
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"status": "created",
"entry": {
"entry_id": "<string>",
"ontology": "<string>",
"entry_name": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": [
"<string>"
]
},
"fields": {},
"checksum": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}PUT uses the same validation as create. Identity fields must still match.
Requires
entries:write and an Idempotency-Key.Authorizations
OAuth 2.1 authorization code with PKCE. Implicit and password flows are unsupported.
Headers
Required for mutating requests. Replays with the same key and payload hash return
the original logical result; replays with a different payload hash return 409.
Required string length:
16 - 255Path Parameters
Body
application/json
Optional when deterministic identity fields can derive it.
Available options:
uploaded, staged, missing Show child attributes
Show child attributes
⌘I