Skip to main content
API Reference
Cards
OAuth Connections

When a user authorizes your OAuth application, an OAuth Connection object is created. Learn more about OAuth here.

The OAuth Connection object
{
  "created_at": "2020-01-31T23:59:59Z",
  "deleted_at": null,
  "group_id": "group_1g4mhziu6kvrs3vz35um",
  "id": "connection_dauknoksyr4wilz4e6my",
  "oauth_application_id": "application_gj9ufmpgh5i56k4vyriy",
  "status": "active",
  "type": "oauth_connection"
}
Attributes
created_at
string

The ISO 8601 timestamp when the OAuth Connection was created.

deleted_at
string
Nullable

The ISO 8601 timestamp when the OAuth Connection was deleted.

group_id
string

The identifier of the Group that has authorized your OAuth application.

More about Groups.
id
string

The OAuth Connection’s identifier.

oauth_application_id
string

The identifier of the OAuth application this connection is for.

More about OAuth Applications.
status
enum

Whether the connection is active.

type
string

A constant representing the object’s type. For this resource it will always be oauth_connection.

List OAuth Connections
curl \
  --url "${INCREASE_URL}/oauth_connections" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
import Increase from 'increase';

const client = new Increase({
  apiKey: process.env['INCREASE_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const oauthConnection of client.oauthConnections.list()) {
  console.log(oauthConnection.id);
}
import os
from increase import Increase

client = Increase(
    api_key=os.environ.get("INCREASE_API_KEY"),  # This is the default and can be omitted
)
page = client.oauth_connections.list()
page = page.data[0]
print(page.id)
require "increase"

increase = Increase::Client.new(
  api_key: ENV["INCREASE_API_KEY"] # This is the default and can be omitted
)

page = increase.oauth_connections.list

puts(page)
package main

import (
	"context"
	"fmt"
	"os"

	"github.com/Increase/increase-go"
	"github.com/Increase/increase-go/option"
)

func main() {
	client := increase.NewClient(
		option.WithAPIKey(os.Getenv("INCREASE_API_KEY")), // This is the default and can be omitted
	)
	page, err := client.OAuthConnections.List(context.TODO(), increase.OAuthConnectionListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
package com.increase.api.example;

import com.increase.api.client.IncreaseClient;
import com.increase.api.client.okhttp.IncreaseOkHttpClient;
import com.increase.api.models.oauthconnections.OAuthConnectionListPage;
import com.increase.api.models.oauthconnections.OAuthConnectionListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        IncreaseClient client = IncreaseOkHttpClient.fromEnv();

        OAuthConnectionListPage page = client.oauthConnections().list();
    }
}
package com.increase.api.example

import com.increase.api.client.IncreaseClient
import com.increase.api.client.okhttp.IncreaseOkHttpClient
import com.increase.api.models.oauthconnections.OAuthConnectionListPage
import com.increase.api.models.oauthconnections.OAuthConnectionListParams

fun main() {
    val client: IncreaseClient = IncreaseOkHttpClient.fromEnv()

    val page: OAuthConnectionListPage = client.oauthConnections().list()
}
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Increase\Client;
use Increase\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('INCREASE_API_KEY'));

try {
  $page = $client->oauthConnections->list(
    cursor: 'cursor',
    limit: 1,
    oauthApplicationID: 'oauth_application_id',
    status: ['in' => ['active']],
  );

  var_dump($page);
} catch (APIException $e) {
  echo $e->getMessage();
}
using System;
using Increase.Api;
using Increase.Api.Models.OAuthConnections;

IncreaseClient client = new();

OAuthConnectionListParams parameters = new();

var page = await client.OAuthConnections.List(parameters);
await foreach (var item in page.Paginate())
{
    Console.WriteLine(item);
}
Returns a list response :
{
  "data": [
    { /* OAuth Connection object */ },
    { /* OAuth Connection object */ }
    /* ... */
  ],
  "next_cursor": "v57w5d",
}
Parameters
status.in
array of strings

Filter to OAuth Connections by their status. By default, return only the active ones. For GET requests, this should be encoded as a comma-delimited string, such as ?in=one,two,three.

oauth_application_id
string

Filter results to only include OAuth Connections for a specific OAuth Application.

More about OAuth Applications.
More
cursor
string
limit
integer
Retrieve an OAuth Connection
curl \
  --url "${INCREASE_URL}/oauth_connections/connection_dauknoksyr4wilz4e6my" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
import Increase from 'increase';

const client = new Increase({
  apiKey: process.env['INCREASE_API_KEY'], // This is the default and can be omitted
});

const oauthConnection = await client.oauthConnections.retrieve('connection_dauknoksyr4wilz4e6my');

console.log(oauthConnection.id);
import os
from increase import Increase

client = Increase(
    api_key=os.environ.get("INCREASE_API_KEY"),  # This is the default and can be omitted
)
oauth_connection = client.oauth_connections.retrieve(
    "connection_dauknoksyr4wilz4e6my",
)
print(oauth_connection.id)
require "increase"

increase = Increase::Client.new(
  api_key: ENV["INCREASE_API_KEY"] # This is the default and can be omitted
)

oauth_connection = increase.oauth_connections.retrieve("connection_dauknoksyr4wilz4e6my")

puts(oauth_connection)
package main

import (
	"context"
	"fmt"
	"os"

	"github.com/Increase/increase-go"
	"github.com/Increase/increase-go/option"
)

func main() {
	client := increase.NewClient(
		option.WithAPIKey(os.Getenv("INCREASE_API_KEY")), // This is the default and can be omitted
	)
	oauthConnection, err := client.OAuthConnections.Get(context.TODO(), "connection_dauknoksyr4wilz4e6my")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", oauthConnection.ID)
}
package com.increase.api.example;

import com.increase.api.client.IncreaseClient;
import com.increase.api.client.okhttp.IncreaseOkHttpClient;
import com.increase.api.models.oauthconnections.OAuthConnection;
import com.increase.api.models.oauthconnections.OAuthConnectionRetrieveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        IncreaseClient client = IncreaseOkHttpClient.fromEnv();

        OAuthConnection oauthConnection = client.oauthConnections().retrieve("connection_dauknoksyr4wilz4e6my");
    }
}
package com.increase.api.example

import com.increase.api.client.IncreaseClient
import com.increase.api.client.okhttp.IncreaseOkHttpClient
import com.increase.api.models.oauthconnections.OAuthConnection
import com.increase.api.models.oauthconnections.OAuthConnectionRetrieveParams

fun main() {
    val client: IncreaseClient = IncreaseOkHttpClient.fromEnv()

    val oauthConnection: OAuthConnection = client.oauthConnections().retrieve("connection_dauknoksyr4wilz4e6my")
}
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Increase\Client;
use Increase\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('INCREASE_API_KEY'));

try {
  $oauthConnection = $client->oauthConnections->retrieve(
    'connection_dauknoksyr4wilz4e6my'
  );

  var_dump($oauthConnection);
} catch (APIException $e) {
  echo $e->getMessage();
}
using System;
using Increase.Api;
using Increase.Api.Models.OAuthConnections;

IncreaseClient client = new();

OAuthConnectionRetrieveParams parameters = new()
{
    OAuthConnectionID = "connection_dauknoksyr4wilz4e6my"
};

var oauthConnection = await client.OAuthConnections.Retrieve(parameters);

Console.WriteLine(oauthConnection);
Parameters
oauth_connection_id
string
Required

The identifier of the OAuth Connection.

Between 1 and 200 characters