okta-sdk-nodejs

okta.PolicyApi

All URIs are relative to https://subdomain.okta.com

Method HTTP request Description
activatePolicy POST /api/v1/policies/{policyId}/lifecycle/activate Activate a Policy
activatePolicyRule POST /api/v1/policies/{policyId}/rules/{ruleId}/lifecycle/activate Activate a Policy Rule
clonePolicy POST /api/v1/policies/{policyId}/clone Clone an existing policy
createPolicy POST /api/v1/policies Create a Policy
createPolicyRule POST /api/v1/policies/{policyId}/rules Create a Policy Rule
deactivatePolicy POST /api/v1/policies/{policyId}/lifecycle/deactivate Deactivate a Policy
deactivatePolicyRule POST /api/v1/policies/{policyId}/rules/{ruleId}/lifecycle/deactivate Deactivate a Policy Rule
deletePolicy DELETE /api/v1/policies/{policyId} Delete a Policy
deletePolicyRule DELETE /api/v1/policies/{policyId}/rules/{ruleId} Delete a Policy Rule
getPolicy GET /api/v1/policies/{policyId} Retrieve a Policy
getPolicyRule GET /api/v1/policies/{policyId}/rules/{ruleId} Retrieve a Policy Rule
listPolicies GET /api/v1/policies List all Policies
listPolicyRules GET /api/v1/policies/{policyId}/rules List all Policy Rules
updatePolicy PUT /api/v1/policies/{policyId} Replace a Policy
updatePolicyRule PUT /api/v1/policies/{policyId}/rules/{ruleId} Replace a Policy Rule

activatePolicy

void activatePolicy()

Activates a policy.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiActivatePolicyRequest = {
  // string
  policyId: "policyId_example",
};

apiInstance.activatePolicy(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyId [string]   defaults to undefined

Return type

void

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 204 | No Content | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

activatePolicyRule

void activatePolicyRule()

Activates a policy rule.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiActivatePolicyRuleRequest = {
  // string
  policyId: "policyId_example",
  // string
  ruleId: "ruleId_example",
};

apiInstance.activatePolicyRule(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyId [string]   defaults to undefined
ruleId [string]   defaults to undefined

Return type

void

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 204 | No Content | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

clonePolicy

Policy clonePolicy()

Clones an existing policy.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiClonePolicyRequest = {
  // string
  policyId: "policyId_example",
};

apiInstance.clonePolicy(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyId [string]   defaults to undefined

Return type

Policy

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 400 | Bad Request | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createPolicy

Policy createPolicy(policy)

Creates a policy.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiCreatePolicyRequest = {
  // Policy
  policy: {},
  // boolean (optional)
  activate: true,
};

apiInstance.createPolicy(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policy Policy    
activate [boolean]   (optional) defaults to undefined

Return type

Policy

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 400 | Bad Request | - | 403 | Forbidden | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createPolicyRule

PolicyRule createPolicyRule(policyRule)

Creates a policy rule.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiCreatePolicyRuleRequest = {
  // string
  policyId: "policyId_example",
  // PolicyRule
  policyRule: {},
};

apiInstance.createPolicyRule(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyRule PolicyRule    
policyId [string]   defaults to undefined

Return type

PolicyRule

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 400 | Bad Request | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deactivatePolicy

void deactivatePolicy()

Deactivates a policy.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiDeactivatePolicyRequest = {
  // string
  policyId: "policyId_example",
};

apiInstance.deactivatePolicy(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyId [string]   defaults to undefined

Return type

void

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 204 | No Content | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deactivatePolicyRule

void deactivatePolicyRule()

Deactivates a policy rule.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiDeactivatePolicyRuleRequest = {
  // string
  policyId: "policyId_example",
  // string
  ruleId: "ruleId_example",
};

apiInstance.deactivatePolicyRule(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyId [string]   defaults to undefined
ruleId [string]   defaults to undefined

Return type

void

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 204 | No Content | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deletePolicy

void deletePolicy()

Removes a policy.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiDeletePolicyRequest = {
  // string
  policyId: "policyId_example",
};

apiInstance.deletePolicy(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyId [string]   defaults to undefined

Return type

void

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 204 | No Content | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deletePolicyRule

void deletePolicyRule()

Removes a policy rule.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiDeletePolicyRuleRequest = {
  // string
  policyId: "policyId_example",
  // string
  ruleId: "ruleId_example",
};

apiInstance.deletePolicyRule(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyId [string]   defaults to undefined
ruleId [string]   defaults to undefined

Return type

void

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 204 | No Content | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getPolicy

Policy getPolicy()

Gets a policy.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiGetPolicyRequest = {
  // string
  policyId: "policyId_example",
  // string (optional)
  expand: "",
};

apiInstance.getPolicy(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyId [string]   defaults to undefined
expand [string]   (optional) defaults to ‘’

Return type

Policy

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getPolicyRule

PolicyRule getPolicyRule()

Gets a policy rule.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiGetPolicyRuleRequest = {
  // string
  policyId: "policyId_example",
  // string
  ruleId: "ruleId_example",
};

apiInstance.getPolicyRule(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyId [string]   defaults to undefined
ruleId [string]   defaults to undefined

Return type

PolicyRule

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listPolicies

Array listPolicies()

Gets all policies with the specified type.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiListPoliciesRequest = {
  // string
  type: "type_example",
  // string (optional)
  status: "status_example",
  // string (optional)
  expand: "",
};

apiInstance.listPolicies(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
type [string]   defaults to undefined
status [string]   (optional) defaults to undefined
expand [string]   (optional) defaults to ‘’

Return type

**Array**

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listPolicyRules

Array listPolicyRules()

Enumerates all policy rules.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiListPolicyRulesRequest = {
  // string
  policyId: "policyId_example",
};

apiInstance.listPolicyRules(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyId [string]   defaults to undefined

Return type

**Array**

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updatePolicy

Policy updatePolicy(policy)

Updates a policy.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiUpdatePolicyRequest = {
  // string
  policyId: "policyId_example",
  // Policy
  policy: {},
};

apiInstance.updatePolicy(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policy Policy    
policyId [string]   defaults to undefined

Return type

Policy

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 400 | Bad Request | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updatePolicyRule

PolicyRule updatePolicyRule(policyRule)

Updates a policy rule.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.PolicyApi(configuration);

let body:okta.PolicyApiUpdatePolicyRuleRequest = {
  // string
  policyId: "policyId_example",
  // string
  ruleId: "ruleId_example",
  // PolicyRule
  policyRule: {},
};

apiInstance.updatePolicyRule(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
policyRule PolicyRule    
policyId [string]   defaults to undefined
ruleId [string]   defaults to undefined

Return type

PolicyRule

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 400 | Bad Request | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]