Create an account
Section titled “Create an account”Open registration and enter your email, password, and an optional name. After registration, you land in your personal organization’s function list. If you already have an account, sign in.
Replace the name and email below, run the request, and enter your password when prompted. This example uses Python 3 to prepare the JSON body:
python3 - <<'PY' | curl https://api.str.ing/auth/register \ -H 'Content-Type: application/json' \ --data-binary @-import getpassimport json
print(json.dumps({ "name": "Alex Example", "email": "you@example.com", "password": getpass.getpass("Password: "),}))PYSet STRING_TOKEN to the session_token returned in the response. If you
already have an account, use the login endpoint.
Create an account if needed. With the str CLI
installed, sign in and choose your organization during authorization:
str loginstr api uses the credential saved by str login. In request paths,
{org} expands to that credential’s organization slug.
Choose an organization
Section titled “Choose an organization”Organizations define your team’s permissions, members, spending controls, and API keys. Use the organization whose access and spending should apply to your work.
The breadcrumb at the top of the page shows the current organization. Open the organization picker in the sidebar to select another organization you belong to. On a phone, open the navigation menu first.
Check your account’s memberships:
curl https://api.str.ing/auth/verify \ -H "Authorization: Bearer $STRING_TOKEN"Choose a slug from the response’s organizations array. Replace acme below
with that slug.
Check which organization your credential acts for:
str api /auth/whoamiTo choose another organization, run str login again and select it during
authorization.
Create a function
Section titled “Create a function”Creating a function requires a role with write access. Viewers can read the list.
On the Functions page, enter a name such as Classify support tickets and submit the creation form. The new function appears in the list. Open it to edit and save its draft source.
curl https://api.str.ing/acme/functions \ -H "Authorization: Bearer $STRING_TOKEN" \ -H 'Content-Type: application/json' \ -d '{"name":"Classify support tickets"}'Use the returned slug or ID to save a draft.
str api '/{org}/functions' -d '{"name":"Classify support tickets"}'Use the returned slug or ID to save a draft.
Return later
Section titled “Return later”Sign in again to return to your personal organization, or your first available organization. Choose Sign out in the navigation when you finish using a shared device.
Use your session token until it expires. Send POST /auth/logout to end the
session; see authentication.
Your saved CLI credential is reused across commands. Run str logout to remove
it when you finish using a shared machine.