Ask PCIFIC errors

Every error Ask PCIFIC and its documents can return, what causes it and how to fix it, with the mistakes integrations make most often first.

Most Ask PCIFIC error bodies have a docs link to their section on this page (or, for key, credit and limit errors, on the shared errors page). A streamed answer that fails after it started ends with an error event carrying the same fields. What an error body holds is explained in Errors, limits and retries.

Common mistakes

The ways integrations most often go wrong, written as what you see. Each one links to the errors it causes.

Every question is refused with nothing to answer from

Ask PCIFIC answers only from your live documents. With none added, or with every version still waiting for approval, each question is 409 ASK_NO_DOCUMENTS. Add a document with POST /api/v1/documents, and approve it on the dashboard if your review mode is approve_first.

My question is refused before it is answered

The question goes in a field called question. Sending it as q, message or prompt leaves question missing: 400 ASK_QUESTION_MISSING. A question over 1,500 characters, such as a whole chat history pasted in, is 400 ASK_QUESTION_TOO_LONG: send only the newest question and carry the chat on with conversationId.

Adding my returns policy fails

Send pasted text with a title, or a public https web page in url, but not both: 400 DOCUMENT_CONTENT_MISSING otherwise, and text with no title is 400 DOCUMENT_TITLE_MISSING. A file upload needs its form part named file (400 DOCUMENT_FILE_MISSING). A scanned PDF is only a picture of text, so it is 400 DOCUMENT_EMPTY: upload the original document instead.

My web page document is refused

A document's url must be a public https address. http, an address with a user name or password, or a page on your own network such as an intranet is 400 DOCUMENT_ADDRESS_NOT_ALLOWED. A page PCIFIC cannot open is 502 DOCUMENT_FETCH_FAILED.

Carrying on a chat fails

conversationId must be the one an earlier answer gave you for this business. A made-up id, or one over 30 days old, is 404 ASK_CONVERSATION_NOT_FOUND. With keepChats off there are no chats to carry on: 400 ASK_CHATS_OFF.

My item lookup does not work

Sending item.id without listing lookup is 400 ASK_ITEM_LOOKUP_NOT_CONFIGURED, before any AI call or usage. Set up lookup, or leave item.id out and send the listing details instead. The lookup address must contain {id}, where PCIFIC puts the item's id, and be a public https address: 400 INVALID_ITEM_SOURCE otherwise. Test it with POST /api/v1/ask-pcific/item-source/test before buyers do. Your address answering 404 is ASK_ITEM_NOT_FOUND, and an error, a redirect or more than 5 seconds is 502 ASK_ITEM_LOOKUP_FAILED.

My key cannot approve documents or change the review mode

Approving or rejecting a waiting version, and changing reviewMode, are for a person on the dashboard, never an API key: 403 DOCUMENT_DECISION_NEEDS_DASHBOARD and 403 REVIEW_MODE_NEEDS_DASHBOARD.

INVALID_JSON

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • The body is not a JSON object.

How to fix it

  • Send a JSON object with the header "Content-Type: application/json".
INVALID_JSON: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_QUESTION_MISSING

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • The question is missing or only spaces.

How to fix it

  • Send the customer's question as text, like {"question": "Can I return this?"}.
ASK_QUESTION_MISSING: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_QUESTION_INVALID

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • The question must be text.

How to fix it

  • Send the customer's question as text, like {"question": "Can I return this?"}.
ASK_QUESTION_INVALID: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_QUESTION_TOO_LONG

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • The question is over 1,500 characters.

How to fix it

  • Shorten the question and send it again.
ASK_QUESTION_TOO_LONG: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_ACCOUNT_ID_INVALID

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • buyer has an unknown key, an account id has the wrong shape, or a lookup reservation holder is invalid; the error names the field and whether it is in the lookup response.

How to fix it

  • Inside buyer send only accountId. Use opaque ids of 1 to 128 ASCII letters, digits, dots, colons, underscores or hyphens, never names or usernames. If the error names the item lookup response, correct reservedForAccountId there and test the lookup again.
ASK_ACCOUNT_ID_INVALID: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_PRICE_INVALID

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • A caller price or structured lookup price is malformed; the error names the price field and whether it is in the lookup response.

How to fix it

  • For caller input, send item.price as {amount: 9575, currency: GBP}, using a nonnegative whole number in the smallest unit and a three letter currency code in capitals. For a lookup response, correct price in the configured lookup and test it again; caller item fields are ignored.
ASK_PRICE_INVALID: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_QUOTES_INVALID

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • quotes was sent but is not true or false.

How to fix it

  • Send quotes: true to request a document quote, or leave quotes out.
ASK_QUOTES_INVALID: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

INVALID_ITEM

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • Something in item has the wrong shape or is too long: item is not an object, item.id is not 1 to 128 characters of text or a number, type, title or url is too long, details has over 60 entries, or a detail is not one plain value.

How to fix it

  • Read the message, which names the field. Send item as {"id": "abc-123", "title": "...", "details": {...}} with short plain values, or leave item out.
INVALID_ITEM: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_ITEM_ID_NOT_ALLOWED

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • The item id is . or .., which in a web address means a different folder, not an item. (POST /api/v1/ask-pcific)
  • On test: the item id is . or .., which in a web address means a different folder, not an item. (POST /api/v1/ask-pcific/item-source/test)

How to fix it

  • Send the item's real id, like "abc-123".
ASK_ITEM_ID_NOT_ALLOWED: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_TURNED_OFF

HTTP 403. PCIFIC knows who is calling, but this caller may not do this right now.

Usual causes

  • Ask PCIFIC is switched off for this account.

How to fix it

  • Switch it on in the dashboard, or send {"enabled": true} to PUT /api/v1/ask-pcific/settings.
ASK_TURNED_OFF: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_CHATS_OFF

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • conversationId was sent, but the account keeps no chats (keepChats is false), so there is no chat to carry on.

How to fix it

  • Leave conversationId out: each question is answered on its own. To keep chats, send {"keepChats": true} to PUT /api/v1/ask-pcific/settings.
ASK_CHATS_OFF: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_CONVERSATION_NOT_FOUND

HTTP 404. What the address points at does not exist for this key, or no longer exists.

Usual causes

  • conversationId is not a chat of this account. It may be wrong, belong to another business, or be older than 30 days after its last question.

How to fix it

  • Leave conversationId out to start a new chat.
ASK_CONVERSATION_NOT_FOUND: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_ITEM_NOT_FOUND

HTTP 404. What the address points at does not exist for this key, or no longer exists.

Usual causes

  • Item lookup is set up, and your lookup address answered "not found" for this item id. (POST /api/v1/ask-pcific)
  • On test: your lookup address answered "not found" for this id. (POST /api/v1/ask-pcific/item-source/test)

How to fix it

  • Check the item id is right, or turn item lookup off and send the item's details in item.details instead.
  • Check the item id is right, or send the item's details in item.details instead.
ASK_ITEM_NOT_FOUND: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_NO_DOCUMENTS

HTTP 409. The request is well formed, but it does not fit where the work is now.

Usual causes

  • The account has no live document to answer from. Either none was added, the only versions are waiting for approval, or the approved documents are unpublished.

How to fix it

  • Add a document with POST /api/v1/documents or on the dashboard Documents page. If you approve changes first, ask an owner or admin to approve the waiting version there. For an unpublished approved document, use Publish again on Documents.
ASK_NO_DOCUMENTS: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_CHAT_TOO_FAST

HTTP 429. Too much was sent too fast, or a daily or spending limit was reached. Retry-After says when to try again.

Usual causes

  • This chat has asked 20 questions in the last minute, more than a person can type.

How to fix it

  • Wait a minute and send the question again. If a real customer sees this, check your code sends each question once, not again on every retry or page refresh.
ASK_CHAT_TOO_FAST: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_ITEM_LOOKUP_FAILED

HTTP 502. PCIFIC, or a service it relies on, could not answer.

Usual causes

  • Item lookup is set up, but your lookup address failed, took over 5 seconds, sent back over 256 KB, redirected to a different website, or did not answer a JSON object. (POST /api/v1/ask-pcific)
  • On test: your lookup address failed, took over 5 seconds, sent back over 256 KB, redirected to a different website, or did not answer a JSON object. (POST /api/v1/ask-pcific/item-source/test)

How to fix it

  • Test the address with POST /api/v1/ask-pcific/item-source/test and check it answers one item as a JSON object.
  • Check the address answers one item as a JSON object, then test it again.
ASK_ITEM_LOOKUP_FAILED: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_ITEM_LOOKUP_NOT_CONFIGURED

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • item.id was sent but listing lookup is not set up for this business. The request is refused before any AI call or usage.

How to fix it

  • Set up listing lookup in Ask PCIFIC settings, or leave item.id out and send the listing details in the request instead.
ASK_ITEM_LOOKUP_NOT_CONFIGURED: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_MODEL_FAILED

HTTP 502. PCIFIC, or a service it relies on, could not answer.

Usual causes

  • PCIFIC's AI could not finish the answer. This is a problem on PCIFIC's side.

How to fix it

  • Send the question again in a few minutes. If it still fails, contact PCIFIC support.
ASK_MODEL_FAILED: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

AI_PROVIDERS_BLOCKED

HTTP 503. PCIFIC, or a service it relies on, is too busy or not available right now.

Usual causes

  • Every AI model that could answer is from a provider PCIFIC has blocked for your business.

How to fix it

  • Contact PCIFIC support to allow another AI provider for your business, then send the question again.
AI_PROVIDERS_BLOCKED: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_EMPTY_ANSWER

HTTP 502. PCIFIC, or a service it relies on, could not answer.

Usual causes

  • The AI finished without writing anything.

How to fix it

  • Send the question again. If it keeps happening, contact PCIFIC support.
ASK_EMPTY_ANSWER: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

ASK_TIMEOUT

HTTP 504. PCIFIC took longer to answer than the address allows.

Usual causes

  • The answer took longer than 30 seconds and was stopped.

How to fix it

  • Send the question again.
ASK_TIMEOUT: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"question":"Can I return this coat if I change my mind?","quotes":true,"item":{"type":"listing","title":"Wool coat, navy, size M","details":{"condition":"Used, good","status":"Available"}}}'

INVALID_SETTING

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • A setting has the wrong type, is out of range, is too long or contains HTML tags in a plain-text field. The message names it.

How to fix it

  • Use plain text without HTML tags for text settings. Send the setting in the form the message shows, then send the request again.
INVALID_SETTING: a request that works
curl -X PUT "https://business.pcific.ai/api/v1/ask-pcific/settings" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"supportLink":"https://example.com/help","webSearch":false}'

REVIEW_MODE_NEEDS_DASHBOARD

HTTP 403. PCIFIC knows who is calling, but this caller may not do this right now.

Usual causes

  • An API key tried to change reviewMode at PUT /api/v1/ask-pcific/settings.

How to fix it

  • Ask an owner or admin to change it on the dashboard Documents page.
REVIEW_MODE_NEEDS_DASHBOARD: a request that works
curl -X PUT "https://business.pcific.ai/api/v1/ask-pcific/settings" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"supportLink":"https://example.com/help","webSearch":false}'

INVALID_ITEM_SOURCE

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • On PUT: url is missing, has no {id}, is over 2,000 characters, is not a public https address, or headerName and headerValue were not sent together. On test: id is missing.

How to fix it

  • Put {id} where the item's id goes, like https://api.example.com/items/{id}. Send headerName and headerValue together, or neither.
INVALID_ITEM_SOURCE: a request that works
curl -X PUT "https://business.pcific.ai/api/v1/ask-pcific/item-source" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://api.example.com/items/{id}","headerName":"Authorization","headerValue":"Bearer your-items-api-key"}'

ASK_NO_ITEM_SOURCE

HTTP 409. The request is well formed, but it does not fit where the work is now.

Usual causes

  • On test: item lookup is not set up.

How to fix it

  • Set it with PUT /api/v1/ask-pcific/item-source.
ASK_NO_ITEM_SOURCE: a request that works
curl -X POST "https://business.pcific.ai/api/v1/ask-pcific/item-source/test" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"id":"coat-8841","buyer":{"accountId":"opaque-buyer-1"}}'

INVALID_LIMIT

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • limit in the address is not a whole number from 1 to 200.

How to fix it

  • Send a number from 1 to 200, like ?limit=50, or leave it out for the newest 50.
INVALID_LIMIT: a request that works
curl -X GET "https://business.pcific.ai/api/v1/ask-pcific/unanswered" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY"

INVALID_FIELD

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • A field has the wrong type or is too long. problems names each one.

How to fix it

  • Fix each place named in problems, using its tryThis, then send the request again.
INVALID_FIELD: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

INVALID_DOCUMENT_TAGS

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • The document tags field is not an array of up to 5 different lowercase words, each 1 to 24 letters (a to z).

How to fix it

  • Send tags as an array such as ["returns", "shipping"], or [] to clear them. For uploads, send the same JSON array in a part named tags.
INVALID_DOCUMENT_TAGS: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_TITLE_MISSING

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • You sent pasted text with no title.

How to fix it

  • Add a "title" naming the document, for example "Returns policy".
DOCUMENT_TITLE_MISSING: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_CONTENT_MISSING

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • You sent neither text nor url, or both.

How to fix it

  • Send the document's text as "text", or its web address as "url", or upload a file as multipart/form-data with a "file" field.
DOCUMENT_CONTENT_MISSING: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_FILE_MISSING

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • The upload has no part named file.

How to fix it

  • Send the document in a multipart/form-data field named "file".
DOCUMENT_FILE_MISSING: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

INVALID_UPLOAD

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • The file upload could not be read.

How to fix it

  • Send the file as multipart/form-data with the file in a field named "file".
INVALID_UPLOAD: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_TITLE_TOO_LONG

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • The title is over 200 characters.

How to fix it

  • Use a short name for the document, for example "Returns policy".
DOCUMENT_TITLE_TOO_LONG: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_ADDRESS_NOT_ALLOWED

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • The web address is not https, has a user name or password in it, or points at a private or local address.

How to fix it

  • Use the public https:// address of the page, as it appears in a browser.
DOCUMENT_ADDRESS_NOT_ALLOWED: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_EMPTY

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • No text was found in the document, for example a scanned PDF, which is only a picture of text.

How to fix it

  • Check you sent the right file or text. For a scanned PDF, copy its text in and send it as "text" instead.
DOCUMENT_EMPTY: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_NOT_HTML

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • An uploaded web page (.html or .htm) file has no HTML tags in it, so it is not really a web page.

How to fix it

  • Upload the real web page, saved from your browser, or save the text as a .txt file and upload that instead.
DOCUMENT_NOT_HTML: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_LIMIT_REACHED

HTTP 409. The request is well formed, but it does not fit where the work is now.

Usual causes

  • The business already has 50 documents.

How to fix it

  • Delete a document you no longer need, or join related documents into one.
DOCUMENT_LIMIT_REACHED: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_UPLOAD_LIMIT

HTTP 429. Too much was sent too fast, or a daily or spending limit was reached. Retry-After says when to try again.

Usual causes

  • Your business has two document uploads or refreshes in progress, or its reserved input bytes are full. All shops and keys share this allowance. Busy background refreshes stay due for the next run.

How to fix it

  • Try this document upload again in 20 seconds. Retry-After is 20.
DOCUMENT_UPLOAD_LIMIT: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_UPLOAD_BUSY

HTTP 503. PCIFIC, or a service it relies on, is too busy or not available right now.

Usual causes

  • PCIFIC's document upload capacity is full, or no PDF reader became available within two seconds.

How to fix it

  • Try this document upload again in 20 seconds. Retry-After is 20.
DOCUMENT_UPLOAD_BUSY: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_UPLOAD_TIMEOUT

HTTP 408. The request body did not finish arriving in time, so nothing was done.

Usual causes

  • The document upload did not finish arriving within 20 seconds.

How to fix it

  • Check your connection, then try the document upload again. Split a large file into smaller documents if needed.
DOCUMENT_UPLOAD_TIMEOUT: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_FILE_TOO_LARGE

HTTP 413. The request is bigger than this address accepts.

Usual causes

  • The file is larger than 10 MB.

How to fix it

  • Split the document into smaller files, or paste its text instead.
DOCUMENT_FILE_TOO_LARGE: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_TOO_LARGE

HTTP 413. The request is bigger than this address accepts.

Usual causes

  • The document is over 300,000 characters once converted, or a Word file's text unpacks to over 20 MB.

How to fix it

  • Split it into smaller documents, for example one per policy.
DOCUMENT_TOO_LARGE: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENTS_FULL

HTTP 413. The request is bigger than this address accepts.

Usual causes

  • The documents together would be over 2,000,000 characters.

How to fix it

  • Delete documents Ask PCIFIC no longer needs, or shorten this one.
DOCUMENTS_FULL: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_TYPE_NOT_SUPPORTED

HTTP 415. The Content-Type header names a format this address does not take.

Usual causes

  • The file is not a PDF, Word (.docx), web page (.html), Markdown (.md) or plain text (.txt) file.

How to fix it

  • Send a PDF, Word (.docx), web page (.html), Markdown (.md) or plain text (.txt) file.
DOCUMENT_TYPE_NOT_SUPPORTED: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_UNREADABLE

HTTP 422. The body was read, but what it holds cannot be used.

Usual causes

  • The file is damaged, password protected, text that is not UTF-8 or contains binary control characters, or a PDF that took too long or too much memory to read.

How to fix it

  • Open the file to check it is not damaged or password protected, or copy its text in and send it as "text" instead.
DOCUMENT_UNREADABLE: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

DOCUMENT_FETCH_FAILED

HTTP 502. PCIFIC, or a service it relies on, could not answer.

Usual causes

  • The page could not be read: it does not exist, would not let PCIFIC in, was too slow, is not a web page, PDF or text file, or has almost no text. (POST /api/v1/documents, PUT /api/v1/documents/{id}/content)
  • The page could not be read. The last good version stays live and the reason is saved in lastCheck. (POST /api/v1/documents/{id}/refresh)

How to fix it

  • Check the address opens in a private browser window without signing in. If the page needs scripts to show its text, upload it as a file or paste its text instead.
DOCUMENT_FETCH_FAILED: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@policy.txt"

NOT_FOUND

HTTP 404. What the address points at does not exist for this key, or no longer exists.

Usual causes

  • No document with this id for your business. (GET /api/v1/documents/{id}, DELETE /api/v1/documents/{id}, PUT /api/v1/documents/{id}/content and 4 more)
  • No document or version with this id for your business. (GET /api/v1/documents/{id}/versions/{versionId}, POST /api/v1/documents/{id}/versions/{versionId})

How to fix it

  • Check the id. Ids from another business, or from before it was deleted, are not found.
NOT_FOUND: a request that works
curl -X GET "https://business.pcific.ai/api/v1/documents/$ID" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY"

DOCUMENT_REFRESH_TOO_SOON

HTTP 429. Too much was sent too fast, or a daily or spending limit was reached. Retry-After says when to try again.

Usual causes

  • Refresh now was requested for this website document within the last minute.

How to fix it

  • Wait one minute after the last refresh attempt, then try Refresh now again.
DOCUMENT_REFRESH_TOO_SOON: a request that works
curl "https://business.pcific.ai/api/v1/documents/$ID" -H "Authorization: Bearer $PCIFIC_TEST_KEY"

DOCUMENT_NOT_A_WEB_PAGE

HTTP 409. The request is well formed, but it does not fit where the work is now.

Usual causes

  • The document is pasted text or a file.

How to fix it

  • To change this document, send its new text or file to PUT /api/v1/documents/{id}/content.
DOCUMENT_NOT_A_WEB_PAGE: a request that works
curl -X POST "https://business.pcific.ai/api/v1/documents/$ID/refresh" \
  -H "Authorization: Bearer $PCIFIC_TEST_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

DOCUMENT_DECISION_NEEDS_DASHBOARD

HTTP 403. PCIFIC knows who is calling, but this caller may not do this right now.

Usual causes

  • An API key tried to approve or reject a waiting version. No API key, test or live, is allowed to.

How to fix it

  • Ask an owner or admin of your business to approve or reject it on the Documents page of your PCIFIC dashboard.
DOCUMENT_DECISION_NEEDS_DASHBOARD: a request that works
curl "https://business.pcific.ai/api/v1/documents/$ID" -H "Authorization: Bearer $PCIFIC_TEST_KEY"

DECISION_MISSING

HTTP 400. The request itself needs changing: a field, header, address or body is not in the form this address takes.

Usual causes

  • The decision is missing or is not "approve" or "reject".

How to fix it

  • Send {"decision": "approve"} to make this version live, or {"decision": "reject"} to discard it.
DECISION_MISSING: a request that works
curl "https://business.pcific.ai/api/v1/documents/$ID" -H "Authorization: Bearer $PCIFIC_TEST_KEY"

VERSION_NOT_WAITING

HTTP 409. The request is well formed, but it does not fit where the work is now.

Usual causes

  • The version is not waiting for approval, or another person decided it a moment before.

How to fix it

  • Only a version with status waiting can be decided. Open the document to see its waiting version, if it has one.
VERSION_NOT_WAITING: a request that works
curl "https://business.pcific.ai/api/v1/documents/$ID" -H "Authorization: Bearer $PCIFIC_TEST_KEY"

DOCUMENT_UNDO_UNAVAILABLE

HTTP 409. The request is well formed, but it does not fit where the work is now.

Usual causes

  • The document's 10-second Undo window ended, or it is not awaiting removal.

How to fix it

  • Reload Documents to check the list. If removed, add it again from your original text, file or web address.
DOCUMENT_UNDO_UNAVAILABLE: a request that works
curl "https://business.pcific.ai/api/v1/documents" -H "Authorization: Bearer $PCIFIC_TEST_KEY"