C1 API: The C1 API is a HTTP API for managing C1 resources.
To add the SDK as a dependency to your project:
go get github.com/conductorone/conductorone-sdk-gopackage main
import (
"context"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
"log"
)
func main() {
ctx := context.Background()
s := NewWithCredentials(ctx, &ClientCredentials{
ClientID: "",
ClientSecret: "",
} )
res, err := s.Apps.Create(ctx, &shared.CreateAppRequest{
Owners: []string{
"string",
},
})
if err != nil {
log.Fatal(err)
}
if res.CreateAppResponse != nil {
// handle response
}
}Available methods
- CreateSurfaceFeedback - Create Surface Feedback
- ListSurfaceFeedback - List Surface Feedback
- ListSurfaces - List Surfaces
- SubmitAction - Submit Action
- CreateMonitor - Create Monitor
- DeleteMonitor - Delete Monitor
- GetMonitor - Get Monitor
- UpdateMonitor - Update Monitor
- GetCampaignScopeAndEntitlements - Get Campaign Scope And Entitlements
- SetCampaignScopeAndEntitlements - Set Campaign Scope And Entitlements
- SetCampaignScopeByResourceType - Set Campaign Scope By Resource Type
- GetScopeAndEntitlements - Get Scope And Entitlements
- SetScopeAndEntitlements - Set Scope And Entitlements
- SetScopeByResourceType - Set Scope By Resource Type
- Test - Test
- CancelAppAccessRequestsDefaults - Cancel App Access Requests Defaults
- CreateAppAccessRequestsDefaults - Create App Access Requests Defaults
- GetAppAccessRequestsDefaults - Get App Access Requests Defaults
- CreateAppEntitlementMonitorBinding - Create App Entitlement Monitor Binding
- DeleteAppEntitlementMonitorBinding - Delete App Entitlement Monitor Binding
- GetAppEntitlementMonitorBinding - Get App Entitlement Monitor Binding
- SearchEntitlementOwners - Search Entitlement Owners
- SearchUserOwners - Search User Owners
- Set - Set
- AddAutomationExclusion - Add Automation Exclusion
- AddManuallyManagedMembers - Add Manually Managed Members
- Create - Create
- CreateAutomation - Create Automation
- Delete - Delete
- DeleteAutomation - Delete Automation
- Get - Get
- GetAutomation - Get Automation
- List - List
- ListAutomationExclusions - List Automation Exclusions
- ListForAppResource - List For App Resource
- ListForAppUser - List For App User
ListUsers- List Users⚠️ Deprecated- RemoveAutomationExclusion - Remove Automation Exclusion
- RemoveEntitlementMembership - Remove Entitlement Membership
- Update - Update
- UpdateAutomation - Update Automation
- Search - Search
- SearchAppEntitlementsForAppUser - Search App Entitlements For App User
- SearchAppEntitlementsWithExpired - Search App Entitlements With Expired
- SearchGrants - Search Grants
- ListAppUsersForIdentityWithGrant - List App Users For Identity With Grant
- RemoveGrantDuration - Remove Grant Duration
- SearchGrantFeed - Search Grant Feed
- SearchPastGrants - Search Past Grants
- UpdateGrantDuration - Update Grant Duration
- CreateEntitlementOwner - Create Entitlement Owner
- CreateUserOwner - Create User Owner
- DeleteEntitlementOwner - Delete Entitlement Owner
- DeleteUserOwner - Delete User Owner
- GetEntitlementOwner - Get Entitlement Owner
- GetUserOwner - Get User Owner
- SearchEntitlementOwners - Search Entitlement Owners
- SearchUserOwners - Search User Owners
- Set - Set
- List - List
- GenerateReport - Generate Report
- CreateManuallyManagedAppResource - Create Manually Managed App Resource
- DeleteManuallyManagedAppResource - Delete Manually Managed App Resource
- Get - Get
- List - List
- Update - Update
- SearchAppResourceTypes - Search App Resource Types
- SearchAppResources - Search App Resources
- CreateManuallyManagedResourceType - Create Manually Managed Resource Type
- DeleteManuallyManagedResourceType - Delete Manually Managed Resource Type
- Get - Get
- List - List
- UpdateManuallyManagedResourceType - Update Manually Managed Resource Type
- Search - Search
- SearchUserOwnership - Search User Ownership
- List - List
- ListAppUserCredentials - List App User Credentials
- ListAppUsersForUser - List App Users For User
- Search - Search
- Update - Update
- CreateAttributeValue - Create Attribute Value
- CreateComplianceFrameworkAttributeValue - Create Compliance Framework Attribute Value
- CreateRiskLevelAttributeValue - Create Risk Level Attribute Value
- DeleteAttributeValue - Delete Attribute Value
- DeleteComplianceFrameworkAttributeValue - Delete Compliance Framework Attribute Value
- DeleteRiskLevelAttributeValue - Delete Risk Level Attribute Value
- GetAttributeValue - Get Attribute Value
- GetComplianceFrameworkAttributeValue - Get Compliance Framework Attribute Value
- GetRiskLevelAttributeValue - Get Risk Level Attribute Value
- ListAttributeTypes - List Attribute Types
- ListAttributeValues - List Attribute Values
- ListComplianceFrameworks - List Compliance Frameworks
- ListRiskLevels - List Risk Levels
- SearchAttributeValues - Search Attribute Values
- Introspect - Introspect
- ClearAutomationCircuitBreaker - Clear Automation Circuit Breaker
- CreateAutomation - Create Automation
- DeleteAutomation - Delete Automation
- ExecuteAutomation - Execute Automation
- GetAutomation - Get Automation
- ListAutomations - List Automations
- ResolvePausedAutomationExecutions - Resolve Paused Automation Executions
- UpdateAutomation - Update Automation
- GetAutomationExecution - Get Automation Execution
- ListAutomationExecutions - List Automation Executions
- TerminateAutomation - Terminate Automation
- SearchAllAutomationExecutions - Search All Automation Executions
- SearchAutomationExecutions - Search Automation Executions
- SearchAutomationTemplateVersions - Search Automation Template Versions
- SearchAutomations - Search Automations
- Get - Get
- ConfirmSyncValid - Confirm Sync Valid
- Create - Create
- CreateDelegated - Create Delegated
- Delete - Delete
- ForceSync - Force Sync
- Get - Get
- GetConnectorSyncDownloadURL - Get Connector Sync Download Url
- GetCredentials - Get Credentials
- List - List
- PauseSync - Pause Sync
- ResumeSync - Resume Sync
- RevokeCredential - Revoke Credential
- RotateCredential - Rotate Credential
- Update - Update
- UpdateConnectorSchedule - Update Connector Schedule
- UpdateDelegated - Update Delegated
- ValidateHTTPConnectorConfig - Validate Http Connector Config
- ConfigurationSchema - Configuration Schema
- GetContacts - Get Contacts
- UpdateContacts - Update Contacts
- Search - Search
- Search - NOTE: Searches external client grants for all users
- BulkCreateFindingTasks - Bulk Create Finding Tasks
- BulkUpdateFindingState - Bulk Update Finding State
- CreateFindingTask - Create Finding Task
- GetFinding - Get Finding
- UpdateFindingState - Update Finding State
- CreateFindingRoutingRule - Create Finding Routing Rule
- DeleteFindingRoutingRule - Delete Finding Routing Rule
- GetFindingRoutingRule - Get Finding Routing Rule
- ListFindingRoutingRules - List Finding Routing Rules
- UpdateFindingRoutingRule - Update Finding Routing Rule
- Search - Search
- CreateFinalCommit - Create Final Commit
- CreateFunction - Create Function
- CreateInitialCommit - Create Initial Commit
- CreateTag - Create Tag
- DeleteFunction - Delete Function
- GetCommitContent - Get Commit Content
- GetFunction - Get Function
- GetLockFile - Get Lock File
- Invoke - Invoke
- ListCommits - List Commits
- ListFunctions - List Functions
- ListTags - List Tags
- Test - Test
- UpdateFunction - Update Function
- Search - Search
- Search - Search
- Search - Search
- CreateExternal - Create External
- CreateInternal - Create Internal
- Get - Get
- GetByShareCode - Get By Share Code
- GetContent - Get Content
- Revoke - Revoke
- SearchAuditEvents - Search Audit Events
- SearchMySecrets - Search My Secrets
- SetTextContent - Set Text Content
- Get - Get
- Revoke - Revoke
- Search - Search
- SearchAuditEvents - Search Audit Events
- Create - Create
- Delete - Delete
- Get - Get
- List - NOTE: Only shows personal clients for the current user.
- Update - Update
- Search - NOTE: Searches personal clients for all users
- Search - Search
- ValidateCEL - Validate Cel
- AddBinding - Add Binding
- Create - Create
- CreateCredential - Create Credential
- Delete - Delete
- DeleteBinding - Delete Binding
- Get - Get
- GetCredential - Get Credential
- List - List
- ListBindings - List Bindings
- ListCredentials - List Credentials
- RevokeCredential - Revoke Credential
- Update - Update
- UpdateCredential - Update Credential
- AddAccessEntitlements - Add Access Entitlements
- AddAppEntitlements - Add App Entitlements
- Create - Create
- CreateBundleAutomation - Create Bundle Automation
- CreateRequestableEntry - Create Requestable Entry
- Delete - Delete
- DeleteBundleAutomation - Delete Bundle Automation
- DeleteRequestableEntry - Delete Requestable Entry
- ForceRunBundleAutomation - Force Run Bundle Automation
- Get - Get
- GetBundleAutomation - Get Bundle Automation
- GetRequestableEntry - Get Requestable Entry
- List - List
- ListAllEntitlementIdsPerApp - List All Entitlement Ids Per App
- ListEntitlementsForAccess - List Entitlements For Access
- ListEntitlementsPerCatalog - List Entitlements Per Catalog
- RemoveAccessEntitlements - Remove Access Entitlements
- RemoveAppEntitlements - Remove App Entitlements
- ResumePausedBundleAutomation - Resume Paused Bundle Automation
- SetBundleAutomation - Set Bundle Automation
- Update - Update
- UpdateAppEntitlements - Update App Entitlements
- SearchEntitlements - Search Entitlements
- Create - Create
- CreateEntitlementBinding - Create Entitlement Binding
- Delete - Delete
- FindBindingForAppEntitlement - Find Binding For App Entitlement
- Get - Get
- RemoveEntitlementBinding - Remove Entitlement Binding
- Update - Update
- CreateAccessProfileFromCohort - Create Access Profile From Cohort
- GetCustomAnalysisResult - Get Custom Analysis Result
- GetLatestRun - Get Latest Run
- GetRoleMiningConfig - Get Role Mining Config
- GetSuggestion - Get Suggestion
- ListRuns - List Runs
- ListSuggestions - List Suggestions
- SearchCohortUsers - Search Cohort Users
- TriggerAnalysis - Trigger Analysis
- TriggerCustomAnalysis - Trigger Custom Analysis
- UpdateRoleMiningConfig - Update Role Mining Config
- UpdateSuggestionState - Update Suggestion State
- Search - Search
- Get - Get
- TestSourceIP - Test Source Ip
- Update - Update
- List - List
- Search - Search
- Create - Create
- Delete - Delete
- Get - Get
- GetStats - Get Stats
- List - List
- Test - Test
- Update - Update
- Create - Create
- Delete - Delete
- Get - Get
- List - List
- Search - Search
- Test - Test
- Update - Update
- UpdateSecret - Update Secret
- ListEvents - List Events
- CreateGrantTask - Create Grant Task
- CreateOffboardingTask - Create Offboarding Task
- CreateRevokeTask - Create Revoke Task
- Get - Get
- Approve - Approve
- ApproveWithStepUp - Approve With Step Up
- Close - Close
- Comment - Comment
- Deny - Deny
- EscalateToEmergencyAccess - Escalate To Emergency Access
- HardReset - Hard Reset
- ProcessNow - Process Now
- Reassign - Reassign
- Restart - Restart
- SkipStep - Skip Step
- UpdateGrantDuration - Update Grant Duration
- UpdateRequestData - Update Request Data
- List - List
- Search - Search
- Get - Get
- GetEmailCapabilities - Get Email Capabilities
- SearchAuditEvents - Search Audit Events
- Test - Test
- Update - Update
- Get - Get
- GetUserProfileTypes - Get User Profile Types
- List - List
- SetExpiringUserDelegationBindingByAdmin - Set Expiring User Delegation Binding By Admin
- Search - Search
- Search - Search
- CreateProvider - Create Provider
- CreateTrust - Create Trust
- DeleteProvider - Delete Provider
- DeleteTrust - Delete Trust
- GetProvider - Get Provider
- GetTrust - Get Trust
- ListProviders - List Providers
- ListTrusts - List Trusts
- SearchTrusts - Search Trusts
- TestCEL - Test Cel
- TestToken - Test Token
- UpdateProvider - Update Provider
- UpdateTrust - Update Trust
Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass.
| Error Object | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 400-600 | / |
package main
import (
"context"
"errors"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/sdkerrors"
"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
"log"
)
func main() {
ctx := context.Background()
s := NewWithCredentials(ctx, &ClientCredentials{
ClientID: "",
ClientSecret: "",
})
res, err := s.Apps.Create(ctx, &shared.CreateAppRequest{
Owners: []string{
"string",
},
})
if err != nil {
var e *sdkerrors.SDKError
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
}
}package main
import (
"context"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
"log"
)
func main() {
ctx := context.Background()
/* Optional Override
* Server URL will be extracted from client, optionally, you can
* provide a server URL or a tenant domain (will create URL https://{tenant_domain}.conductor.one)
*/
opts := []sdk.CustomSDKOption{}
opt, _ := sdk.WithTenantCustom("Server URL or Tenant Domain")
opts = append(opts, opt)
s := NewWithCredentials(ctx, &ClientCredentials{
ClientID: "",
ClientSecret: "",
} opts...)
res, err := s.Apps.Create(ctx, &shared.CreateAppRequest{
Owners: []string{
"string",
},
})
if err != nil {
log.Fatal(err)
}
if res.CreateAppResponse != nil {
// handle response
}
}Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
returned response object will have a Next method that can be called to pull down the next group of results. If the
return value of Next is nil, then there are no more pages to be fetched.
Here's an example of one such pagination call:
package main
import (
"context"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go"
"github.com/conductorone/conductorone-sdk-go/pkg/models/shared"
"log"
)
func main() {
ctx := context.Background()
s := conductoronesdkgo.New(
conductoronesdkgo.WithSecurity(shared.Security{
BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
Oauth: "<YOUR_OAUTH_HERE>",
}),
)
res, err := s.AppEntitlementSearch.Search(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.AppEntitlementSearchServiceSearchResponse != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply provide a retry.Config object to the call by using the WithRetries option:
package main
import (
"context"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go"
"github.com/conductorone/conductorone-sdk-go/pkg/models/operations"
"github.com/conductorone/conductorone-sdk-go/pkg/models/shared"
"github.com/conductorone/conductorone-sdk-go/pkg/retry"
"log"
"pkg/models/operations"
)
func main() {
ctx := context.Background()
s := conductoronesdkgo.New(
conductoronesdkgo.WithSecurity(shared.Security{
BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
Oauth: "<YOUR_OAUTH_HERE>",
}),
)
res, err := s.A2UI.CreateSurfaceFeedback(ctx, operations.C1APIA2uiV1A2UIServiceCreateSurfaceFeedbackRequest{
SurfaceID: "<id>",
}, operations.WithRetries(
retry.Config{
Strategy: "backoff",
Backoff: &retry.BackoffStrategy{
InitialInterval: 1,
MaxInterval: 50,
Exponent: 1.1,
MaxElapsedTime: 100,
},
RetryConnectionErrors: false,
}))
if err != nil {
log.Fatal(err)
}
if res.A2UIServiceCreateSurfaceFeedbackResponse != nil {
// handle response
}
}If you'd like to override the default retry strategy for all operations that support retries, you can use the WithRetryConfig option at SDK initialization:
package main
import (
"context"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go"
"github.com/conductorone/conductorone-sdk-go/pkg/models/operations"
"github.com/conductorone/conductorone-sdk-go/pkg/models/shared"
"github.com/conductorone/conductorone-sdk-go/pkg/retry"
"log"
)
func main() {
ctx := context.Background()
s := conductoronesdkgo.New(
conductoronesdkgo.WithRetryConfig(
retry.Config{
Strategy: "backoff",
Backoff: &retry.BackoffStrategy{
InitialInterval: 1,
MaxInterval: 50,
Exponent: 1.1,
MaxElapsedTime: 100,
},
RetryConnectionErrors: false,
}),
conductoronesdkgo.WithSecurity(shared.Security{
BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
Oauth: "<YOUR_OAUTH_HERE>",
}),
)
res, err := s.A2UI.CreateSurfaceFeedback(ctx, operations.C1APIA2uiV1A2UIServiceCreateSurfaceFeedbackRequest{
SurfaceID: "<id>",
})
if err != nil {
log.Fatal(err)
}
if res.A2UIServiceCreateSurfaceFeedbackResponse != nil {
// handle response
}
}This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release !