Create integration credentials - SuperAI Flows

Create integration credentials

cURL

curl --request POST \
  --url https://flows.super.ai/api/integrations/credentials \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '\n{\n  "credentials": {},\n  "name": "<string>"\n}\n'\n```

### Python

import requests

url = "https://flows.super.ai/api/integrations/credentials"

payload = { "credentials": {}, "name": "" } headers = { "X-API-Key": "", "Authorization": "Bearer ", "Content-Type": "application/json" }

response = requests.post(url, json=payload, headers=headers)

print(response.text)


### JavaScript (Fetch)

const options = { method: 'POST', headers: { 'X-API-Key': '', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: JSON.stringify({credentials: {}, name: ''}) };

fetch('https://flows.super.ai/api/integrations/credentials', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));


### PHP
"https://flows.super.ai/api/integrations/credentials",\ CURLOPT_RETURNTRANSFER => true,\ CURLOPT_ENCODING => "",\ CURLOPT_MAXREDIRS => 10,\ CURLOPT_TIMEOUT => 30,\ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\ CURLOPT_CUSTOMREQUEST => "POST",\ CURLOPT_POSTFIELDS => json_encode([\ 'credentials' => [\ \ ],\ 'name' => ''\ ]),\ CURLOPT_HTTPHEADER => [\ "Authorization: Bearer ",\ "Content-Type: application/json",\ "X-API-Key: "\ ],\ ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ?>

### Go

package main

import ( "fmt" "strings" "net/http" "io" )

func main() {

url := "https://flows.super.ai/api/integrations/credentials"

payload := strings.NewReader("{\n "credentials": {},\n "name": ""\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-API-Key", "") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close() body, _ := io.ReadAll(res.Body)

fmt.Println(string(body)) }


### Java (Unirest)

HttpResponse response = Unirest.post("https://flows.super.ai/api/integrations/credentials") .header("X-API-Key", "") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n "credentials": {},\n "name": ""\n}") .asString();


### Ruby

require 'uri' require 'net/http'

url = URI("https://flows.super.ai/api/integrations/credentials")

http = Net::HTTP.new(url.host, url.port) http.use_ssl = true

request = Net::HTTP::Post.new(url) request["X-API-Key"] = '' request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n "credentials": {},\n "name": ""\n}"

response = http.request(request) puts response.read_body


### Response Example

{ "created_at": "2023-11-07T05:31:56Z", "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "modified_by": "", "name": "", "updated_at": "2023-11-07T05:31:56Z", "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }


### Authorizations

#### X-API-Key

- **type**: string
- **location**: header
- **required**: true

API key authentication. Include your API key in the `X-API-Key` header as: `X-API-Key YOUR_API_KEY`

#### Authorization

- **type**: string
- **location**: header
- **required**: true

JWT Bearer token authentication. Include your access token in the `Authorization` header as: `Bearer YOUR_ACCESS_TOKEN`

### Body

**application/json**  
Request model for creating user integration credentials

- **credential_type**: enum<string> (required)  
Available options: `api_key`, `oauth2`, `user_password`, `key_file`, `client_credentials`, `sharepoint_receive`, `google_drive_receive`

- **credentials**: Credentials · object (required)

- **name**: string (required)

- **provider**: enum<string> (required)  
Available options: `microsoft`, `sftp`, `aws_ses`, `google`, `postgresql`, `internal_postgresql`, `file_storage`, `sharepoint_client_secret`

### Response

- **created_at**: string<date-time> (required)
- **id**: string<uuid> (required)
- **modified_by**: string (required)
- **name**: string (required)
- **updated_at**: string<date-time> (required)
- **user_id**: string<uuid> | null

[List user credentials](https://docs.flows.super.ai/api-reference/integrations/list-user-credentials)