Skip to content

Delete Credential

client.Credentials.Delete(ctx, credentialID) (*CredentialDeleteResponse, error)
DELETE/v5/credentials/{credential_id}

Permanently delete a credential and all its associated data.

ParametersExpand Collapse
credentialID string
ReturnsExpand Collapse
type CredentialDeleteResponse struct{…}
ID string
Deleted bool
Object stringOptional

Delete Credential

package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  credential, err := client.Credentials.Delete(context.TODO(), "credential_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", credential.ID)
}
{
  "id": "id",
  "deleted": true,
  "object": "object"
}
Returns Examples
{
  "id": "id",
  "deleted": true,
  "object": "object"
}