> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://api.docs.modulards.com/modular-ds-public-api/websites/connection/create-a-website-login-link/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server. # Create a website login link POST https://api.modulards.com/api/public/v1/sites/{site}/login Creates a single-use link that signs you in to the website's WordPress dashboard as its default WordPress user, without a password. Open `meta.login_url` in a browser; it stays valid for 10 minutes and the answer also carries `meta.expires_at`. A successful login is recorded in the organization's activity. **Errors** - **400**: the website is not connected, or has no WordPress user synchronized yet. - **404**: the member cannot sign in to this website. - **503**: Modular DS cannot issue the link right now because the store that keeps the single-use link is unavailable. Retry in a moment. Reference: https://api.docs.modulards.com/modular-ds-public-api/websites/connection/create-a-website-login-link ## Authentication - `Authorization` header (bearer token, required) — Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints. ## Request ### Path parameters - `site` (string, required) ## Response ### 200 200 - Login link issued - `jsonapi` (ApiPublicV1SitesSiteLoginPostResponsesContentApplicationJsonSchemaJsonapi, optional) - `meta` (ApiPublicV1SitesSiteLoginPostResponsesContentApplicationJsonSchemaMeta, optional) ## Types ### ApiPublicV1SitesSiteLoginPostResponsesContentApplicationJsonSchemaJsonapi - `version` (string, optional) ### ApiPublicV1SitesSiteLoginPostResponsesContentApplicationJsonSchemaMeta - `expires_at` (datetime, optional) — When the login link stops working, 10 minutes after it was issued. - `login_url` (string, optional) — Single-use URL that signs in to the website's WordPress dashboard when opened in a browser. ## Examples **Response** ```json { "jsonapi": { "version": "1.1" }, "meta": { "expires_at": "2026-09-17T10:10:00.000000Z", "login_url": "https://api.modulards.com/api/sites/123/login/redirect?expires=1789650000&nonce=FAKE_NONCE&origin=public&signature=FAKE_SIGNATURE&user=456" } } ``` **SDK Code** ```python 200 - Login link issued import requests url = "https://api.modulards.com/api/public/v1/sites/site/login" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript 200 - Login link issued const url = 'https://api.modulards.com/api/public/v1/sites/site/login'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go 200 - Login link issued package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/sites/site/login" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby 200 - Login link issued require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/sites/site/login") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java 200 - Login link issued import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.modulards.com/api/public/v1/sites/site/login") .header("Authorization", "Bearer ") .asString(); ``` ```php 200 - Login link issued request('POST', 'https://api.modulards.com/api/public/v1/sites/site/login', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp 200 - Login link issued using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/sites/site/login"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift 200 - Login link issued import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/sites/site/login")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```