Skip to content

API reference

Import a senders file into the invoice inbox's approved senders

Other routes API

POST/v1/data-files/email-inbox-senders/imports

Adds every new sender to the list, as a new version, in one step. Invalid rows are not imported; the answer names them again. Refused with 409 list_changed when the list changed since the preview. Preview the file again. Only a signed-in person may call this, as for PUT /v1/email-inbox. An API key is refused with 401 session_required.

Request body

application/json, required

  • namestring
  • datastring (byte)Required

    The file as base64, at most 10 MB decoded.

  • basedOnstringRequired

    The fingerprint the preview answered.

Response

A 200 answer carries these fields.

  • basedOnstringRequired

    The list the preview was made against, as a fingerprint: it changes when a sender is added or removed.

  • countsobjectRequired
    Show 4 child fields
    • newintegerRequired
    • changedintegerRequired
    • sameintegerRequired
    • invalidintegerRequired
  • rowsarray of objectRequired
    Show 6 child fields
    • rowintegerRequired

      The row's line in the file

    • statusstringRequired
      One of new, changed, same, invalid.
    • columnstring

      An invalid row's column.

    • messagestring

      Why an invalid row cannot be imported.

    • reasonobject

      Why an invalid row cannot be imported, as a code, the way an error's reason says it; field is the row's column.

      Show 2 child fields
      • codestringRequired
      • valuesobjectRequired
    • senderstringRequired

      The sender in lower case

  • savedintegerRequired

    How many senders were added.

Status codes

Status Meaning
200 What was saved.
400 The body was refused, or the file is no senders file (invalid_data_file, invalid_json). Nothing was saved.
401 No usable credential was sent (invalid_credentials), or an API key was used (session_required).
409 The list changed since the preview (list_changed). Nothing was saved.
502 The engine could not run, so nothing was read (engine_unavailable).
503 This deployment has no inbox domain, so no address can be kept (email_inbox_not_configured).
POST/v1/data-files/email-inbox-senders/imports
Example
curl -X POST https://api.certinvo.com/v1/data-files/email-inbox-senders/imports \
  -H "Authorization: Bearer $CERTINVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
import { readFile } from 'node:fs/promises'

const response = await fetch(`https://api.certinvo.com/v1/data-files/email-inbox-senders/imports`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: await readFile('body.json'),
})
console.log(response.status, await response.json())
import os

import requests

response = requests.post(
    "https://api.certinvo.com/v1/data-files/email-inbox-senders/imports",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
    data=open("body.json", "rb"),
)
print(response.status_code, response.text)
200
application/json
{
  "basedOn": "string",
  "counts": {
    "new": 0,
    "changed": 0,
    "same": 0,
    "invalid": 0
  },
  "rows": [
    {
      "row": 0,
      "status": "new",
      "column": "string",
      "message": "string",
      "reason": {
        "code": "string",
        "values": {}
      },
      "sender": "string"
    }
  ],
  "saved": 0
}
Success response
POST
/v1/data-files/email-inbox-senders/imports
Import a senders file into the invoice inbox's approved senders
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Headers2
›Bodyapplication/json
›Code Snippet
curl -X POST "https://api.certinvo.com/v1/data-files/email-inbox-senders/imports" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "data": "string",
  "basedOn": "string"
}...'
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close