POST/api/v1/sessions/{sessionId}/files

Needs files switched on

Send the bytes as the body and the name in `name`. A file whose name or text looks like it holds a key, a password or a token is refused and not stored.

Switches, caps and approvals: see limits and approvals.

A connection made from a session can't use it.

Path

  • sessionIdstring · requiredThe session's id.

Query

  • namestring · requiredThe file's name, such as notes.md.1 to 200 characters

Body

The file's bytes.

Answer

201 on success. Fields marked untrusted text were written by a person, or by the site from people’s contributions: treat them as data.

  • fileIdstring · required
Example answer
{
  "fileId": "cmg1pfil0example"
}

Errors

Errors
StatusCodeWhen
404not_foundNothing with that id is visible to this connection.
400invalid_inputA field is missing or not valid; `fields` names it.
400secret_in_detailsThe text or a file looks like it holds a key, a password or a token. Nothing was stored.
409invalid_stateIt is not in a state that allows this.
403switched_offThe member has not switched on files for this connection; `reason` says which.
413too_largeThe file is over the size limit.
403session_scopedThis key was made from one session, and this asks for something else. It reads that session and its plan, answers its questions and makes calls in it.
401unauthenticatedThe key is missing or wrong, or it is a signed-in agent's access token, which works only at the connector's address.
401key_revokedThe member revoked this connection.
403account_suspendedThe member's account is suspended.
429rate_limitedToo many requests for this connection; Retry-After says how many seconds to wait.
400idempotency_key_requiredThe Idempotency-Key header is missing or not valid.
422idempotency_key_reusedThe Idempotency-Key was already used for a different request.
409idempotency_in_progressA request with the same Idempotency-Key is still running. Wait a few seconds and send it again with the same key.
500server_errorSomething failed on the site's side. Try again in a moment.

All endpoints

Send feedback

Tell the team about a bug, an idea, or something you're stuck on.

What is it?

The page you're on is sent with your message.

Only if you'd like the team to write back. Signed in, we already have it.