Create a page
Create a hosted login page, with a client and a kit of its own.
POST /organizations/{org}/pages
Creates a page from a name and a slug. A client (with its signing key) and a kit are created for it. Every other field starts from a default: type draft, every login method off, registration off, locales ["en-US"], and legal links pointing at https://{slug}.loginwith.page/privacy, /terms, /cookies and /legal. Change them afterwards with Update a page.
Authorization
Org owner. Anyone else gets 403 forbidden.
Path parameters
| Name | Type | Description |
|---|---|---|
org | string | The organization: its id (org_…) or its slug. It has to be an org your token can manage (see Who can call it) |
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | 1–120 characters, trimmed |
slug | string | yes | a-z, 0-9 and -; up to 63 characters |
No other field is accepted.
Response
201 Created with the created page.
{
"id": "pge_65f1c2a9e4b0d3f7a1c8e904",
"slug": "acme",
"name": "Acme",
"type": "draft",
"customDomain": null,
"clientId": "cli_65f1c2a9e4b0d3f7a1c8e905",
"kitId": "kit_65f1c2a9e4b0d3f7a1c8e906",
"branding": {
"favicon": "https://ui-avatars.com/api/?name=Acme&size=32",
"logo": "https://ui-avatars.com/api/?name=Acme&size=128",
"og_image": "https://placehold.co/1200x630",
"og_image_width": 1200,
"og_image_height": 630,
"primary_color_light": "#4f46e5",
"primary_color_dark": "#818cf8",
"tagline": "",
"description": ""
},
"login_methods": { "password": false, "magic_link": false, "sso": [] },
"allow_registration": false,
"whitelabel": false,
"locales": ["en-US"],
"legal": {
"privacy_policy": "https://acme.loginwith.page/privacy",
"terms_of_service": "https://acme.loginwith.page/terms",
"cookie_policy": "https://acme.loginwith.page/cookies",
"legal_notice": "https://acme.loginwith.page/legal"
}
}
Errors
| Status | error | When |
|---|---|---|
400 | invalid_request | An unknown field, or a value that fails validation. The detail names it |
403 | forbidden | You are not an owner of the org |
409 | conflict | That slug is already taken |
404 | not_found | The org does not exist, or your token cannot manage it |
Example
curl -X POST https://loginwith.loginwith.dev/organizations/acme/pages \
-H "Authorization: Bearer $TOKEN" -H "content-type: application/json" \
-d '{"name": "Acme", "slug": "acme"}'