curl -X POST "https://api.alura.io/v1/workspace/knowledge/guidance" \
-H "Authorization: Bearer $ALURA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 5f0c8e2a-4b1d-4c3e-9a7f-2b5d6e8f0a1c" \
-d '{"category":"knowledge","title":"No refunds on personalised mugs","instruction":"Offer a remake for a printing fault, never a refund for a change of mind."}'const res = await fetch('https://api.alura.io/v1/workspace/knowledge/guidance', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ALURA_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': '5f0c8e2a-4b1d-4c3e-9a7f-2b5d6e8f0a1c',
},
body: JSON.stringify({
"category": "knowledge",
"title": "No refunds on personalised mugs",
"instruction": "Offer a remake for a printing fault, never a refund for a change of mind."
}),
});
console.log(await res.json());import json
import os
import urllib.request
request = urllib.request.Request(
"https://api.alura.io/v1/workspace/knowledge/guidance",
method="POST",
data=json.dumps({
"category": "knowledge",
"title": "No refunds on personalised mugs",
"instruction": "Offer a remake for a printing fault, never a refund for a change of mind."
}).encode(),
headers={
"Authorization": f"Bearer {os.environ['ALURA_API_KEY']}",
"Content-Type": "application/json",
"Idempotency-Key": "5f0c8e2a-4b1d-4c3e-9a7f-2b5d6e8f0a1c",
},
)
with urllib.request.urlopen(request) as response:
print(json.load(response)){
"object": "workspace.guidance",
"id": "e1d2c3b4-a596-4877-8695-a4b3c2d1e0f3",
"category": "knowledge",
"title": "No refunds on personalised mugs",
"instruction": "Offer a remake for a printing fault, never a refund for a change of mind.",
"status": "suggested",
"shop_ids": null,
"language": null,
"source": "user",
"suggested_by": "grant:mock",
"evidence_conversation_ids": null,
"reviewed_by": null,
"reviewed_at": null,
"expires_at": "2026-11-14T12:00:00.654Z",
"used_count": 0,
"created_at": "2026-10-17T12:00:00.654Z",
"updated_at": "2026-10-17T12:00:00.654Z",
"version": "2026-10-17T12:00:00.654321Z"
}{
"type": "https://docs.alura.io/errors/invalid_request",
"title": "Invalid request",
"status": 400,
"code": "invalid_request",
"detail": "Invalid request",
"suggestion": "Fix the request as the detail says, then send it again.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"code": "unauthorized",
"detail": "Unauthorized",
"suggestion": "Send a valid API key as `Authorization: Bearer alura_sk_...`.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/credits_exhausted",
"title": "API credits exhausted",
"status": 402,
"code": "credits_exhausted",
"detail": "API credits exhausted",
"suggestion": "Upgrade the plan or wait for the monthly reset.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/plan_required",
"title": "Plan required",
"status": 403,
"code": "plan_required",
"detail": "Plan required",
"suggestion": "Upgrade the workspace plan to use this operation.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/not_found",
"title": "Not found",
"status": 404,
"code": "not_found",
"detail": "Not found",
"suggestion": "Check the ID, or search for it first.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/method_not_allowed",
"title": "Method not allowed",
"status": 405,
"code": "method_not_allowed",
"detail": "Method not allowed",
"suggestion": "Use one of the methods in the Allow header.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"suggestion": "<string>",
"retryable": true,
"request_id": "<string>",
"upgrade_url": "<string>",
"credits_needed": 123,
"credits_remaining": 123,
"resets_at": "2023-11-07T05:31:56Z",
"shop_id": "<string>",
"state": "login_expired",
"holder": {
"label": "<string>",
"last_seen_at": "<string>"
},
"last_served_at": "<string>",
"action": "<string>"
}{
"type": "https://docs.alura.io/errors/margin_required",
"title": "Margin required",
"status": 422,
"code": "margin_required",
"detail": "Margin required",
"suggestion": "This strategy judges listings against break-even, which needs the shop's margin. Save a margin in the optimizer settings, send `overrides.margin_pct`, or use a strategy without break-even rules (Budget Saver needs none).",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"suggestion": "<string>",
"retryable": true,
"request_id": "<string>",
"upgrade_url": "<string>",
"credits_needed": 123,
"credits_remaining": 123,
"resets_at": "2023-11-07T05:31:56Z",
"retry_after_seconds": 2
}{
"type": "https://docs.alura.io/errors/internal_error",
"title": "Internal error",
"status": 500,
"code": "internal_error",
"detail": "Internal error",
"suggestion": "Retry; if it keeps failing, report the request_id.",
"retryable": true,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/base_unverifiable",
"title": "Base not verifiable",
"status": 503,
"code": "base_unverifiable",
"detail": "Base not verifiable",
"suggestion": "Alura could not read from Etsy the text or inventory this write names a version of, so it could not check it, and nothing was written. Retry after Retry-After.",
"retryable": true,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}Create guidance
Add a rule the assistant follows, live at once or as a suggestion the seller approves.
curl -X POST "https://api.alura.io/v1/workspace/knowledge/guidance" \
-H "Authorization: Bearer $ALURA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 5f0c8e2a-4b1d-4c3e-9a7f-2b5d6e8f0a1c" \
-d '{"category":"knowledge","title":"No refunds on personalised mugs","instruction":"Offer a remake for a printing fault, never a refund for a change of mind."}'const res = await fetch('https://api.alura.io/v1/workspace/knowledge/guidance', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ALURA_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': '5f0c8e2a-4b1d-4c3e-9a7f-2b5d6e8f0a1c',
},
body: JSON.stringify({
"category": "knowledge",
"title": "No refunds on personalised mugs",
"instruction": "Offer a remake for a printing fault, never a refund for a change of mind."
}),
});
console.log(await res.json());import json
import os
import urllib.request
request = urllib.request.Request(
"https://api.alura.io/v1/workspace/knowledge/guidance",
method="POST",
data=json.dumps({
"category": "knowledge",
"title": "No refunds on personalised mugs",
"instruction": "Offer a remake for a printing fault, never a refund for a change of mind."
}).encode(),
headers={
"Authorization": f"Bearer {os.environ['ALURA_API_KEY']}",
"Content-Type": "application/json",
"Idempotency-Key": "5f0c8e2a-4b1d-4c3e-9a7f-2b5d6e8f0a1c",
},
)
with urllib.request.urlopen(request) as response:
print(json.load(response)){
"object": "workspace.guidance",
"id": "e1d2c3b4-a596-4877-8695-a4b3c2d1e0f3",
"category": "knowledge",
"title": "No refunds on personalised mugs",
"instruction": "Offer a remake for a printing fault, never a refund for a change of mind.",
"status": "suggested",
"shop_ids": null,
"language": null,
"source": "user",
"suggested_by": "grant:mock",
"evidence_conversation_ids": null,
"reviewed_by": null,
"reviewed_at": null,
"expires_at": "2026-11-14T12:00:00.654Z",
"used_count": 0,
"created_at": "2026-10-17T12:00:00.654Z",
"updated_at": "2026-10-17T12:00:00.654Z",
"version": "2026-10-17T12:00:00.654321Z"
}{
"type": "https://docs.alura.io/errors/invalid_request",
"title": "Invalid request",
"status": 400,
"code": "invalid_request",
"detail": "Invalid request",
"suggestion": "Fix the request as the detail says, then send it again.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"code": "unauthorized",
"detail": "Unauthorized",
"suggestion": "Send a valid API key as `Authorization: Bearer alura_sk_...`.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/credits_exhausted",
"title": "API credits exhausted",
"status": 402,
"code": "credits_exhausted",
"detail": "API credits exhausted",
"suggestion": "Upgrade the plan or wait for the monthly reset.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/plan_required",
"title": "Plan required",
"status": 403,
"code": "plan_required",
"detail": "Plan required",
"suggestion": "Upgrade the workspace plan to use this operation.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/not_found",
"title": "Not found",
"status": 404,
"code": "not_found",
"detail": "Not found",
"suggestion": "Check the ID, or search for it first.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/method_not_allowed",
"title": "Method not allowed",
"status": 405,
"code": "method_not_allowed",
"detail": "Method not allowed",
"suggestion": "Use one of the methods in the Allow header.",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"suggestion": "<string>",
"retryable": true,
"request_id": "<string>",
"upgrade_url": "<string>",
"credits_needed": 123,
"credits_remaining": 123,
"resets_at": "2023-11-07T05:31:56Z",
"shop_id": "<string>",
"state": "login_expired",
"holder": {
"label": "<string>",
"last_seen_at": "<string>"
},
"last_served_at": "<string>",
"action": "<string>"
}{
"type": "https://docs.alura.io/errors/margin_required",
"title": "Margin required",
"status": 422,
"code": "margin_required",
"detail": "Margin required",
"suggestion": "This strategy judges listings against break-even, which needs the shop's margin. Save a margin in the optimizer settings, send `overrides.margin_pct`, or use a strategy without break-even rules (Budget Saver needs none).",
"retryable": false,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"suggestion": "<string>",
"retryable": true,
"request_id": "<string>",
"upgrade_url": "<string>",
"credits_needed": 123,
"credits_remaining": 123,
"resets_at": "2023-11-07T05:31:56Z",
"retry_after_seconds": 2
}{
"type": "https://docs.alura.io/errors/internal_error",
"title": "Internal error",
"status": 500,
"code": "internal_error",
"detail": "Internal error",
"suggestion": "Retry; if it keeps failing, report the request_id.",
"retryable": true,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}{
"type": "https://docs.alura.io/errors/base_unverifiable",
"title": "Base not verifiable",
"status": 503,
"code": "base_unverifiable",
"detail": "Base not verifiable",
"suggestion": "Alura could not read from Etsy the text or inventory this write names a version of, so it could not check it, and nothing was written. Retry after Retry-After.",
"retryable": true,
"request_id": "req_01JQ5W3H8M2N4P6R8T0V2X4Z6B"
}evidence_conversation_ids, this call reads those conversations from Etsy and needs the Alura Chrome extension. See Chrome extension.curl -X POST "https://api.alura.io/v1/workspace/knowledge/guidance" \
-H "Authorization: Bearer $ALURA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 5f0c8e2a-4b1d-4c3e-9a7f-2b5d6e8f0a1c" \
-d '{"category":"knowledge","title":"No refunds on personalised mugs","instruction":"Offer a remake for a printing fault, never a refund for a change of mind."}'
status (active: used at once; paused: kept but not used), over REST, by an owner or admin whose key holds knowledge:write; source is user. Anything else is a suggestion: status: suggested, never used until the seller approves it in Alura: a create that leaves status out (so a key with full access, as Alura’s keys are, never makes a live rule by accident), one with only knowledge:suggest, and every MCP call. Needs knowledge:suggest or knowledge:write (a suggestion records who suggested it and expires, rejected, after 28 days unreviewed; at most 100 of each kind wait at once (422 knowledge_limit_reached); evidence_conversation_ids are read once each from Etsy to check they are the shop’s). The instruction is at most 2500 characters. HTML is cleaned as Alura cleans it: headings, paragraphs, lists, bold, italic, links (http, https, mailto), quotes and line breaks are kept, everything else removed. shop_ids names the connected shops it applies to (null: every shop; a shop outside the workspace is 404, an empty list 400). At most 100 entries of each kind may be active at once: one more is 422 knowledge_limit_reached (save it paused instead). These are the entries of Alura’s Messages Assistant: what is saved here is what the assistant in Alura uses, and a change in Alura shows here. Retry safely with Idempotency-Key.Headers
Makes a retry safe: the same key with the same request within 24 hours returns the first result (with Idempotent-Replayed: true) instead of writing again. The same key with a different request is a 409 conflict; while the first request still runs, 409 idempotency_processing.
1 - 255Body
Name it to create a live entry: active (the assistant uses it at once) or paused (kept, not used); only an owner or admin with knowledge:write, over REST. Leave it out to save a suggestion, which waits for the seller as suggested (anyone else's create is one, whatever this says).
active, paused The Etsy conversations this is based on, at most 5: each is read once from Etsy to check it is one of the shop's (404 otherwise), which needs the messages:read scope, the Customer analytics permission and live data for the shop. Stored with the entry for the seller's review; never shown to buyers.
1 - 5 elements^[0-9]{1,20}$Response
OK
active: the assistant uses it. paused: kept but not used (a Draft in Alura). suggested: an agent suggested it and it waits for the seller to approve it in Alura; never used until then. rejected: the seller turned the suggestion down, or it expired.
active, paused, suggested, rejected