System Owners
This section covers the API endpoints for managing system owners. You can use these endpoints to retrieve, create, update, and delete system owner information in your application.
The system owner model
The system owner model contains information about solar system owners. Here are the properties included in the system owner model:
Properties
-
- Name
id
- Type
- integer
- Description
-
Unique identifier for the system owner.
-
- Name
name
- Type
- string
- Description
-
Full name of the system owner.
-
- Name
address
- Type
- string
- Description
-
Address of the system owner.
-
- Name
email
- Type
- string
- Description
-
Email address of the system owner.
-
- Name
all_requirements_submitted
- Type
- boolean
- Description
-
Indicates whether all requirements have been submitted for the system owner.
List all system owners
This endpoint allows you to retrieve a paginated list of all system owners. By default, a maximum of ten system owners are shown per page.
Optional parameters
-
- Name
limit
- Type
- integer
- Description
-
Limit the number of system owners returned (default: 10, max: 100).
-
- Name
page
- Type
- integer
- Description
-
Page number for pagination (default: 1).
Request
curl -G https://api.getcurrents.com/v1/system-owners \
-H "Authorization: Bearer {token}" \
-d limit=10 \
-d page=1
Response
{
"data": [
{
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"email_verified_at": "2023-10-02T18:24:47.000000Z",
"begin_onboarding": false,
"created_at": "2023-10-02T18:24:47.000000Z",
"updated_at": "2023-10-02T18:24:47.000000Z"
},
// ... more system owners
],
"links": {
"first": "https://api.getcurrents.com/v1/system-owners?page=1",
"last": "https://api.getcurrents.com/v1/system-owners?page=5",
"prev": null,
"next": "https://api.getcurrents.com/v1/system-owners?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"path": "https://api.getcurrents.com/v1/system-owners",
"per_page": 10,
"to": 10,
"total": 50
}
}
Get a system owner's generators
This endpoint allows you to retrieve all generators (or systems) associated with a specific system owner.
Path parameters
-
- Name
id
- Type
- integer
- Description
-
The ID of the system owner.
Request
curl -X GET https://api.getcurrents.com/v1/system-owners/1/generators \
-H "Authorization: Bearer {token}"
Response
{
"data": [
{
"id": 1,
"address": "123 Solar St, Sunnyville, CA 12345",
"capacity": 5.5,
"panel_count": 20,
"inverter_count": 1,
"created_at": "2023-10-02T18:24:47.000000Z",
"updated_at": "2023-10-02T18:24:47.000000Z"
},
{
"id": 2,
"address": "456 PV Ave, Brighttown, CA 67890",
"capacity": 7.2,
"panel_count": 26,
"inverter_count": 2,
"created_at": "2023-10-03T10:15:30.000000Z",
"updated_at": "2023-10-03T10:15:30.000000Z"
}
],
"links": {
"first": "https://api.getcurrents.com/v1/system-owners/1/generators?page=1",
"last": "https://api.getcurrents.com/v1/system-owners/1/generators?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://api.getcurrents.com/v1/system-owners/1/generators",
"per_page": 15,
"to": 2,
"total": 2
}
}
Create a system owner
This endpoint allows you to add a new system owner to your application. You need to provide the required system owner information in the request body.
Required attributes
-
- Name
name
- Type
- string
- Description
-
Full name of the system owner.
-
- Name
email
- Type
- string
- Description
-
Email address of the system owner.
-
- Name
password
- Type
- string
- Description
-
Password for the system owner account.
Optional attributes
-
- Name
begin_onboarding
- Type
- boolean
- Description
-
Set to true to trigger the onboarding email process (default: false).
Request
curl https://api.getcurrents.com/v1/system-owners \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Smith",
"email": "jane@example.com",
"password": "securepassword123",
"begin_onboarding": true
}'
Response
{
"data": {
"id": 2,
"name": "Jane Smith",
"email": "jane@example.com",
"email_verified_at": null,
"begin_onboarding": true,
"created_at": "2023-10-02T19:30:00.000000Z",
"updated_at": "2023-10-02T19:30:00.000000Z"
}
}
Update a system owner
This endpoint allows you to update an existing system owner's information.
Optional attributes
-
- Name
name
- Type
- string
- Description
-
Full name of the system owner.
-
- Name
email
- Type
- string
- Description
-
Email address of the system owner.
-
- Name
password
- Type
- string
- Description
-
New password for the system owner account.
-
- Name
begin_onboarding
- Type
- boolean
- Description
-
Set to true to trigger the onboarding email process.
Request
curl -X PUT https://api.getcurrents.com/v1/system-owners/2 \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Doe",
"begin_onboarding": true
}'
Response
{
"data": {
"id": 2,
"name": "Jane Doe",
"email": "jane@example.com",
"email_verified_at": null,
"begin_onboarding": true,
"created_at": "2023-10-02T19:30:00.000000Z",
"updated_at": "2023-10-02T20:15:00.000000Z"
}
}
Create a system owner link
This endpoint allows you to create an account link for a system owner to complete the onboarding process.
Required parameters
-
- Name
account
- Type
- string
- Description
-
The ID of the system owner account to create a link for.
-
- Name
refresh_url
- Type
- string
- Description
-
The URL to redirect the system owner to if they need to restart the onboarding process.
-
- Name
return_url
- Type
- string
- Description
-
The URL to redirect the system owner to after they complete the onboarding process.
-
- Name
installer_id
- Type
- string
- Description
-
The ID of the installer associated with this system owner.
Request
curl https://api.getcurrents.com/v1/system-owner-links \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"account": "so_123456789",
"refresh_url": "https://yourplatform.com/reauth",
"return_url": "https://yourplatform.com/return",
"installer_id": "inst_987654321"
}'
Response
{
"object": "system_owner_link",
"created": 1633123456,
"expires_at": 1633127056,
"url": "https://connect.getcurrents.com/start/so_123456789"
}
Delete a system owner
This endpoint allows you to delete a system owner from your application. Note: This action cannot be undone.
Request
curl -X DELETE https://api.getcurrents.com/v1/system-owners/2 \
-H "Authorization: Bearer {token}"
Response
{
"message": "System owner deleted successfully"
}