---
agentTools:
  projectIndex: https://docs.privakey.com/llms.txt
---

# Send Magic Link

Sends a magic link to an email address

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "API Settings",
    "version": "2.4"
  },
  "servers": [
    {
      "url": "https://cloud.privakey.com"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/api/request/sendMagicLink": {
      "post": {
        "summary": "Send Magic Link",
        "description": "Sends a magic link to an email address",
        "operationId": "send-magic-link",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Either Basic or HMAC, depending on how the Request Origin is configured.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Basic <basic creds>"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "url"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "The email address to receive the magic link"
                  },
                  "url": {
                    "type": "string",
                    "description": "The url that will be appended with the magic link token and included in the email"
                  },
                  "duration": {
                    "type": "string",
                    "description": "A value denoting the length of time the magic link is valid. A number with an acceptable unit of time. Acceptable units of time are s for seconds, m for minutes, h for hours, or d for days. E.G. \"24h\" = 24 hours (Default: \"60s\")"
                  },
                  "buttonText": {
                    "type": "string",
                    "description": "The text of the button that will appear in the email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "examples": {
                  "Created": {
                    "value": "{\n    \"requestGuid\": \"b7e58467-ed9a-4c54-81dd-17179b09b283\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestGuid": {
                      "type": "string",
                      "example": "b7e58467-ed9a-4c54-81dd-17179b09b283"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [],
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl --location --request POST \"https://cloud.privakey.com/api/request/sendMagicLink\" --header \"Authorization: Basic <basic creds>\" --header \"Content-Type: application/x-www-form-urlencoded\" --data \"email=test@privakey.com&url=https%3A%2F%2Fwww.privakey.com%2Fvalidate&duration=10m&buttonText=Login\""
            }
          ],
          "samples-languages": [
            "curl"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "660d684fcb33080067214619:660d684fcb33080067214663"
}
```