---
updatedAt: 2026-04-20T23:23:25.000Z
agentTools:
  projectIndex: https://docs.derapi.com/llms.txt
---

# Create a Join session

Create a Join session, and redirect to a vendor's authorization page to allow
the system owner to provide their consent.

This endpoint may be accessed without Derapi authentication, since it is
intended to be usable by frontend code running in system owners' browsers.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "version": "1.0.0",
    "title": "Derapi API Reference",
    "contact": {
      "name": "Derapi.com",
      "url": "https://derapi.com",
      "email": "sales@derapi.com"
    }
  },
  "servers": [
    {
      "url": "https://api.derapi.com"
    }
  ],
  "security": [
    {
      "DerapiAPIKey": []
    }
  ],
  "tags": [
    {
      "name": "Join",
      "description": "Join endpoints for collecting end-customer authorization"
    }
  ],
  "paths": {
    "/join/flows/{id}/authorize": {
      "get": {
        "operationId": "getJoinFlowAuthorize",
        "tags": [
          "Join"
        ],
        "security": [],
        "summary": "Create a Join session",
        "description": "Create a Join session, and redirect to a vendor's authorization page to allow\nthe system owner to provide their consent.\n\nThis endpoint may be accessed without Derapi authentication, since it is\nintended to be usable by frontend code running in system owners' browsers.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The Join flow ID to use for the resulting session.",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "flow-1234"
              ]
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "A opaque client-supplied token which may be used to maintain state between this request and the resulting redirect\nto the flow's redirect URI upon authorization completion, as in OAuth 2.0.\n\nThe client should use a high-entropy random string for this value, e.g. one returned by `crypto.randomUUID()`.\nThe same state parameter will be included as a query string parameter when redirecting to the flow's redirect URI.\n",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "323f8180e8b44a54a428a6f4ff8283aa"
              ]
            }
          },
          {
            "name": "vendor",
            "in": "query",
            "description": "The vendor to authorize with. Must be one of the vendors supplied when the session was created.",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "enphase"
              ]
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect",
            "headers": {
              "Location": {
                "required": true,
                "schema": {
                  "type": "string",
                  "description": "The URL to redirect the system owner to for authorization.",
                  "examples": [
                    "https://api.enphaseenergy.com/oauth/authorize?client_id=1234567890&redirect_uri=https%3A%2F%2Fapi.derapi.com%2Fjoin%2Fcallback%3Fvendor%3Denphase&response_type=code&state=323f8180e8b44a54a428a6f4ff8283aa"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Flow ID not found, or vendor not found in flow.",
            "$ref": "#/components/responses/NotFoundProblemOrErrorPage"
          },
          "422": {
            "description": "Vendor not found in flow.",
            "$ref": "#/components/responses/ValidationProblemOrErrorPage"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "DerapiAPIKey": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "description": "A Derapi-issued API key, provided in the Authorization header with a scheme of 'apikey'.\nFor example: 'Authorization: apikey sk-1234'\n",
        "x-default": "apikey sk-1234"
      }
    },
    "schemas": {
      "SubError": {
        "title": "SubError",
        "type": "object",
        "properties": {
          "detail": {
            "type": "string",
            "description": "A human-readable explanation for this sub-problem.",
            "example": "-1 is less than the minimum of 0"
          },
          "pointer": {
            "type": "string",
            "description": "A pointer to the specific location within the request that triggered this sub-problem.\n\nFor errors in the request body, this will be a JSON Pointer. For query or path parameter errors,\nit will be the name of the parameter with the error, formatted as a JSON Pointer.\n",
            "example": "#/duration"
          },
          "in": {
            "title": "SubErrorIn",
            "type": "string",
            "enum": [
              "query",
              "path",
              "body"
            ],
            "description": "A string describing which part of the request this error was in.",
            "example": "path"
          }
        },
        "required": [
          "detail"
        ],
        "additionalProperties": false
      },
      "ValidationProblem": {
        "title": "ValidationProblem",
        "type": "object",
        "description": "This error is returned when the request submitted by the API caller did not conform\nto Derapi's API specification, or when it contained content which was otherwise semantically\ninvalid. Validation failures may derive from problems within the request body, path,\nor query string parameters.\n\nThe `detail` key will contain a summary of any validation failures, and the `errors`\nkey will contain a listing of each individual validation failure, with `detail` and\n`pointer` keys explaining the failure and providing a\n[JSON Pointer](https://datatracker.ietf.org/doc/html/rfc6901) to its source within the\nsubmitted document.\n",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri-reference",
            "const": "https://docs.derapi.com/reference/errors#validation",
            "description": "A URI reference that identifies the problem type.",
            "example": "https://docs.derapi.com/reference/errors#validation",
            "default": "https://docs.derapi.com/reference/errors#validation"
          },
          "title": {
            "type": "string",
            "description": "A short, human-readable summary of the problem type.",
            "const": "Validation Error",
            "example": "Validation Error",
            "default": "Validation Error"
          },
          "detail": {
            "type": "string",
            "description": "A human-readable explanation specific to this occurrence of the problem.",
            "example": "body: Additional properties are not allowed ('other' was unexpected)"
          },
          "errors": {
            "type": "array",
            "description": "At least one validation error which occurred while processing this request",
            "minLength": 1,
            "items": {
              "$ref": "#/components/schemas/SubError"
            }
          }
        },
        "required": [
          "type",
          "title",
          "detail",
          "errors"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "type": "https://docs.derapi.com/reference/errors#validation",
            "title": "Validation Error",
            "detail": "body: Additional properties are not allowed ('other' was unexpected) (and 1 others)",
            "errors": [
              {
                "detail": "Additional properties are not allowed ('other' was unexpected)",
                "pointer": ""
              },
              {
                "detail": "-1 is less than the minimum of 0",
                "pointer": "/duration"
              }
            ]
          }
        ]
      },
      "NotFoundResource": {
        "title": "NotFoundResource",
        "type": "object",
        "description": "Information about the resource which couldn't be found",
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier of the resource",
            "examples": [
              "solr-abcdefgh"
            ]
          },
          "type": {
            "type": "string",
            "description": "The type of the resource",
            "examples": [
              "solarinverter"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "id",
          "type"
        ]
      },
      "NotFoundProblem": {
        "title": "NotFoundProblem",
        "description": "A NotFoundProblem is returned when a requested resource cannot be found.\n\nIt contains a URI reference that identifies the problem type, a human-readable summary,\nand a human-readable explanation specific to this occurrence of the problem.\n\nCorrect the request by ensuring the resource exists or by using the correct identifier.\n",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri-reference",
            "const": "https://docs.derapi.com/reference/errors#not-found",
            "description": "A URI reference that identifies the problem type.",
            "example": "https://docs.derapi.com/reference/errors#not-found",
            "default": "https://docs.derapi.com/reference/errors#not-found"
          },
          "title": {
            "type": "string",
            "description": "A short, human-readable summary of the problem type.",
            "const": "Not Found",
            "example": "Not Found",
            "default": "Not Found"
          },
          "detail": {
            "type": "string",
            "description": "A human-readable explanation specific to this occurrence of the problem.",
            "example": "Your resource was not found"
          },
          "resource": {
            "$ref": "#/components/schemas/NotFoundResource"
          }
        },
        "required": [
          "type",
          "title",
          "detail"
        ],
        "additionalProperties": false
      }
    },
    "responses": {
      "NotFoundProblemOrErrorPage": {
        "description": "A resource wasn't found",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/NotFoundProblem"
            }
          },
          "text/html": {}
        }
      },
      "ValidationProblemOrErrorPage": {
        "description": "A validation error, or generic HTML error page",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ValidationProblem"
            }
          },
          "text/html": {}
        }
      }
    }
  },
  "x-default-target-integration": "goapi"
}
```