Riferimento API

Azioni

Le azioni sono tutto ciò che fa l'app Okaymate, tramite l'API. Ognuna è uno strumento dell'app, lo stesso che il collega IA dell'attività usa nelle sue chat e che offre il server MCP. Agisce sull'attività della chiave come se ne fosse il proprietario, con gli stessi controlli dell'app.

Elencale per conoscere i loro nomi, cosa fa ciascuna e gli argomenti che accetta in JSON Schema, poi eseguine una con i suoi argomenti come body. Un'azione che legge soltanto funziona con l'Accesso in lettura. Una che modifica qualcosa richiede l'Accesso in lettura e scrittura.

L'account personale di qualcuno, il suo profilo, il piano, le attività, il link di affiliazione e le chat, non è mai accessibile con la chiave di un'attività. Creare una chiave, effettuare un pagamento, caricare un file ed eliminare un account si fanno solo nell'app.

L'oggetto azione

Un'azione dell'app Okaymate, come la usano il collega IA dell'attività e il server MCP.

Attributi

  • objectstring
    Sempre action.
  • namestring
    Il nome dell'azione, app_ seguito da ciò su cui agisce, come app_knowledge.
  • descriptionstring
    Cosa fa l'azione e come usare i suoi argomenti, in inglese.
  • input_schemaobject
    Gli argomenti che accetta, in JSON Schema. Inviali come body di Esegui un'azione.
L'oggetto azione
{
  "object": "action",
  "name": "app_knowledge",
  "description": "The customer chat's knowledge (in its settings: what the team taught it, entries with a title and a text): list, save (a new one without id, or change one: title, text), delete (id). The customer chat answers visitors from it and from the Public files.",
  "input_schema": {
    "type": "object",
    "properties": {
      "action": {
        "type": "string",
        "description": "list, save or delete.",
        "enum": ["list", "save", "delete"]
      },
      "id": {
        "type": "string",
        "description": "The entry's id, to change or delete it."
      },
      "title": {
        "type": "string",
        "description": "Its title."
      },
      "text": {
        "type": "string",
        "description": "What it says."
      }
    },
    "required": ["action"]
  }
}

Elenca le azioni

GET/v1/actionsAccesso in lettura

Restituisce tutte le azioni dell'app, con il loro nome, cosa fa ciascuna e gli argomenti che accetta.

Restituisce

Un elenco di oggetti azione, tutti in una sola pagina.

GET/v1/actions
curl https://okaymate.ai/api/v1/actions \
  -H "Authorization: Bearer $OKAYMATE_API_KEY"
Risposta200
{
  "object": "list",
  "data": [
    {
      "object": "action",
      "name": "app_knowledge",
      "description": "The customer chat's knowledge (in its settings: what the team taught it, entries with a title and a text): list, save (a new one without id, or change one: title, text), delete (id). The customer chat answers visitors from it and from the Public files.",
      "input_schema": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "description": "list, save or delete.",
            "enum": ["list", "save", "delete"]
          },
          "id": {
            "type": "string",
            "description": "The entry's id, to change or delete it."
          },
          "title": {
            "type": "string",
            "description": "Its title."
          },
          "text": {
            "type": "string",
            "description": "What it says."
          }
        },
        "required": ["action"]
      }
    },
    {
      "object": "action",
      "name": "app_customer_chat_install",
      "description": "How the customer chat goes on the business's website (its install, in the customer chat's settings): get (the line to paste and the sites it may run on), sites (sets the sites it may run on: domains, like shop.com; replaces the list).",
      "input_schema": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "description": "get or sites. Default get.",
            "enum": ["get", "sites"]
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "For sites: the domains, like shop.com."
          }
        }
      }
    }
  ]
}

L'oggetto risultato dell'azione

Cosa ha fatto un'azione.

Attributi

  • objectstring
    Sempre action_result.
  • actionstring
    Il nome dell'azione.
  • changedstring o null
    La parte dell'app modificata dall'azione, null se ha solo letto. Le pagine dell'app aperte che la mostrano la ricaricano.
  • resultobject o null
    La risposta dell'azione, così come compare nella pagina stessa dell'app. I suoi campi dipendono dall'azione. Non contiene mai alcun segreto.
L'oggetto risultato dell'azione
{
  "object": "action_result",
  "action": "app_knowledge",
  "changed": "customer_chat",
  "result": {
    "id": "Kn4wT8pQ2z",
    "title": "Opening hours",
    "text": "Open Monday to Saturday, 9am to 7pm.",
    "source": "team",
    "question": null,
    "createdAt": "2026-11-24T09:20:03.000Z",
    "updatedAt": "2026-11-24T09:20:03.000Z"
  }
}

Esegui un'azione

POST/v1/actions/:nameAccesso in lettura

Esegue un'azione sull'attività della chiave, con i suoi argomenti nel body come li nomina il suo input_schema. Con l'Accesso in lettura legge soltanto, e un'azione che modifica qualcosa richiede l'Accesso in lettura e scrittura.

Parametri di percorso

Restituisce

Un oggetto risultato dell'azione.

Errori

  • L'app ha rifiutato l'azione oppure l'azione non è riuscita. Il message spiega perché.
  • La chiave ha l'Accesso in lettura e l'azione, con questi argomenti, modifica qualcosa.
  • L'azione riguarda l'account personale di qualcuno e funziona solo per chi ha effettuato l'accesso a Okaymate.
  • Nessuna azione con questo nome.
POST/v1/actions/:name
curl -X POST \
  https://okaymate.ai/api/v1/actions/app_knowledge \
  -H "Authorization: Bearer $OKAYMATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "save",
    "title": "Opening hours",
    "text": "Open Monday to Saturday, 9am to 7pm."
  }'
Risposta200
{
  "object": "action_result",
  "action": "app_knowledge",
  "changed": "customer_chat",
  "result": {
    "id": "Kn4wT8pQ2z",
    "title": "Opening hours",
    "text": "Open Monday to Saturday, 9am to 7pm.",
    "source": "team",
    "question": null,
    "createdAt": "2026-11-24T09:20:03.000Z",
    "updatedAt": "2026-11-24T09:20:03.000Z"
  }
}